Skip to content

JavaScript heap out of memory due to memory leak #4140

@zhihuahuang

Description

@zhihuahuang
  • Rollup Version: 2.15.2
  • Operating System (or Browser): any
  • Node Version (if applicable): 14
  • Link to reproduction (IMPORTANT, read below):

Expected Behavior

When rollup watch restart, the modules of last time will be released.

Actual Behavior

But it will be not. these modules are still keep by ARRAY_PROTOTYPE.
So it cause a memory leak.

I take memory snapshot before and after watch restart. Please see the picture below:

image

I read the code of ARRAY_PROTOTYPE, then find some code maybe cause memory leak.

expressionsToBeDeoptimizedByKey & thisParametersToBeDeoptimized

ARRAY_PROTOTYPE is a global variable, so the propertyexpressionsToBeDeoptimizedByKey and thisParametersToBeDeoptimized never clear.

image

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions