Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

fix: remove cached modules completely from require cache in disable() #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wenboyu2
Copy link

@wenboyu2 wenboyu2 commented Jan 3, 2019

Problem:
We noticed memory leak with require cache when using mockery.enable({useCleanCache: true}). disalbe() doesn't clean up the cache completely.

Solution:
Remove module references from m._cache as well as the module's parents' children.

@pklingem
Copy link

@mfncooper we've verified this PR fixes the memory leak we were seeing. Any chance of getting this merged?

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

Successfully merging this pull request may close these issues.

3 participants