Skip to content
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

Disabling source map flattening #93

Open
Flaise opened this issue Nov 5, 2015 · 1 comment
Open

Disabling source map flattening #93

Flaise opened this issue Nov 5, 2015 · 1 comment

Comments

@Flaise
Copy link
Contributor

Flaise commented Nov 5, 2015

In a project where I'm using Browserify to generate the client-side JS, the source map flattening step built into Gobble looks like it's taking up so much memory that it kills the entire VM.

Example output:

> gobble watch dist

(...etc)
gobble: 18-moveTo done in 17ms                                        
gobble: 45-merge done in 1ms                                          
∙∙∙∙∙∙∙ processing sourcemaps                                                  
<--- Last few GCs --->

   57975 ms: Mark-sweep 1289.3 (1456.6) -> 1289.2 (1456.6) MB, 337.7 / 0 ms [allocation failure] [GC in old space requested].
   58257 ms: Mark-sweep 1289.2 (1456.6) -> 1275.8 (1456.6) MB, 282.4 / 0 ms [allocation failure] [GC in old space requested].
   58652 ms: Mark-sweep 1289.2 (1456.6) -> 1289.2 (1456.6) MB, 341.4 / 0 ms [last resort gc].
   58938 ms: Mark-sweep 1289.2 (1456.6) -> 1275.8 (1456.6) MB, 285.6 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1c34c9037339 <JS Object>
    1: parse [native json.js:~40] [pc=0x9c5dc9087c0] (this=0x1c34c9038151 <a JSON with map 0x3371f2410911>,r=0x36ae08c04101 <Very long string[931622]>,l=0x1c34c9004131 <undefined>)
    2: arguments adaptor frame: 1->2
    3: getMapFromUrl(aka getMapFromUrl) [gobble/dist/gobble.js:~804] [pc=0x9c5dc9d1a30] (this=0x1c34c9004131 <undefined>,url=0x16fcbb981c09 <Very long string...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Aborted (core dumped)

I can turn off Browserify's source maps and that makes this problem stop happening but that introduces another problem where the debugger only shows me the bundled file instead of the files that created the bundle. Alternatively, I can comment out Gobble's source map flattening step and that leaves me with a source map that makes the debugger display each file individually. It doesn't show me source code but rather the generated code (this may be because one of my build steps doesn't support source maps at all but I haven't isolated the issue yet) but because it's broken up into files, it's manageable so an option to turn off Gobble's source map flattening step would be nice.

@timshannon
Copy link

Same here. In some simpler projects I just want to copy some static, already built content. The gobble sourcemaps piece runs out of memory every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants