Skip to content

Extremely high memory usage #222

Description

@johannesjo

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');
      });

Activity

  1. niemyjski commented on Feb 24, 2021

    @niemyjski

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

  2. lionelchauvin commented on Aug 4, 2021

    @lionelchauvin

    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

  3. michaelAtCoalesce commented on Mar 4, 2022

    @michaelAtCoalesce

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

  4. niemyjski commented on Mar 4, 2022

    @niemyjski

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

  5. michaelAtCoalesce commented on Apr 8, 2022

    @michaelAtCoalesce

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions