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

Extremely high memory usage #222

Open
johannesjo opened this issue May 14, 2020 · 5 comments
Open

Extremely high memory usage #222

johannesjo opened this issue May 14, 2020 · 5 comments

Comments

@johannesjo
Copy link

For a larger codebase with framework code (angular) I am using this module. When several errors are thrown and several stracktraces are requested in a short succession memory usage spikes absolutely out of control.

Expected Behavior

Should require a little bit less memory per error.

Current Behavior

Memory spikes out of control.
This is how stacktraces are requested.

    StackTrace.fromError(err)
      .then((stackframes) => {
        return stackframes
          .splice(0, 20)
          .map((sf) => {
            return sf.toString();
          }).join('\n');
      });
@niemyjski
Copy link

@johannesjo would you mind attaching a snippet or unit test that would reproduce this issue so we could profile it.

@lionelchauvin
Copy link

This line could be the culprit of high memory usage:

var lines = source.split('\n');

A big source file will be splitted each time a function name must be found.
Imagine what happen with a source file of 10Mb and a stacktrace with hundred of function names.

120318906-b29c9080-c2e0-11eb-8de1-d1fe6a88c055

@michaelAtCoalesce
Copy link

we have had browser crashes recently when using the stack trace grabbing functionality - as well as performance issues when gathering stack traces.

@niemyjski
Copy link

Would you mind submitting a pr with a fix, perhaps info could be cached.

@michaelAtCoalesce
Copy link

i noticed that my .map file was 111megabytes, by reworking my webpack.config i was able to get it down to 1mb and i think that is helping reduce the amount of crashing thats going on.

to those in this boat, see if you can split your bundles to be smaller

https://medium.com/hackernoon/the-100-correct-way-to-split-your-chunks-with-webpack-f8a9df5b7758

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

No branches or pull requests

4 participants