-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Massive memory consuming when require('opentype.js') is run #333
Comments
Hi @minsikim Interesting... Actually we just released 0.8.0 so maybe you could try to install the precedent version 0.7.3 and let us know if you have the same issue? |
@Jolg42 Thank you for the fast response Unfortunately, I just tried out 0.7.3 and It's still not working. both Windows and Mac. |
I won't have the time to investigate this issue unfortunately but you should add a link to you repository if it's public as an example. I guess the best way to know what's happening will be to record the memory consumption and see where it's being allocated. You could try: |
Solved it by detuoring opentype variable through main process
but still not sure why it doesn't work directly in the renderer process @Jolg42 thanks again for advice |
I investigated this problem a little bit more. I tried versions through 0.5.0 ~ 0.8.0(opentype.js) electron has a different process layer compared to plain old web apps ++ electron + opentype.js examples
|
@minsikim Indeed I found the circular dependency when I updated Rollup. Could you try to use the version from that branch https://github.com/nodebox/opentype.js/tree/circular-dep-fix and let me if it works for you? |
@Jolg42 I tried https://github.com/nodebox/opentype.js/tree/circular-dep-fix, |
😞 Well I merged it in master. (Btw, I edited your previous comments because the url were broken.) |
This issue is old and I don't know if it has been already investigated but I can confirm that opentype consumes quite a lot of memory when loaded. For context, I am using pdfjs which depends on opentype. Currently installed opentype version is: 1.3.4 |
@ardentia Thanks for the update! Could you somehow test using the current master? 1.3.4 is quite old but there hasn't been a new release to npm yet. |
@Connum thanks for the quick reply. I uninstalled
I assumed that the The allocation timeline snapshot with the latest master looks like this: To be fair, the shallow size this time is bit less but it still seems to be a lot. I took a look at the |
The bin files are only used for testing, in order to get the bundled files, run We definitely need to do performance optimizations. If you can find out which parts cause the highest memory usage, we could prioritise optimizations there. |
I just hat a chance to look at your screenshots now on my computer instead of my phone. What you're seeing there is not the memory that opentype consumes, but diffferent bundles (including opentype.js) whose source code in string format seems to take up that much combined. Opentype.js is indeed the largest one, but that has nothing to say about how it performs during operation. |
Massive memory consuming when require('opentype.js') is run in html of electron app
I'm trying to use this library, but when I add
const opentype = require('opentype.js');
to my code. and It runs.
but when I try to open DevTools it consumes all of my memory 5.6GB and it crashes.
I'm on a Electron project.
I tried the code in the Main process and the renderer process and within the html code.
All the same problem happens.
Environment
Version used: 0.8.0
Font used: none
Node version: v8.10.0
Operating System and version (desktop or mobile): Windows 8.1/10, and OSX
The text was updated successfully, but these errors were encountered: