You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been doing some testing and I have noticed memory usage proportionally increasing when Lucid is consumed in a long running application. Over time this memory usage compounds, and eventually uses a machines full memory allowance, causing various memory exceptions from here on.
This occurs when used in the context of long running application, or one with looping. I can see memory marked as external consistently increases and does not get garbage collected. I have tested using various looping approaches, while loops, for loops, interval loops & async loops in an attempt to try and force this external resource cleanup.
Replication steps are using the Data.from() method to showcase this.
I can see the following:
-External memory constantly increasing in each loop. mainly proportionally, until application end.
-Heap used, increasing/decreasing (stable as expected).
-Rss constantly increasing.
-Array buffers increasing/decreasing (stable as expected).
When we reach the 100k loop, you can see the external memory in use is 209.05mb which is significant.
Hey @dpbeaumont! You're absolutely right, there is a memory leak in Lucid. In fact, there are several. I left a brief explanation in the pull request I opened (#232) to fix this specific issue, and I will continue to open PRs to incrementally resolve memory management issues throughout the library whenever I can.
I've been doing some testing and I have noticed memory usage proportionally increasing when Lucid is consumed in a long running application. Over time this memory usage compounds, and eventually uses a machines full memory allowance, causing various memory exceptions from here on.
This occurs when used in the context of long running application, or one with looping. I can see memory marked as external consistently increases and does not get garbage collected. I have tested using various looping approaches, while loops, for loops, interval loops & async loops in an attempt to try and force this external resource cleanup.
Replication steps are using the
Data.from()
method to showcase this.I can see the following:
-External memory constantly increasing in each loop. mainly proportionally, until application end.
-Heap used, increasing/decreasing (stable as expected).
-Rss constantly increasing.
-Array buffers increasing/decreasing (stable as expected).
When we reach the 100k loop, you can see the external memory in use is 209.05mb which is significant.
StackBlitz here demonstrates the code I used to test this and shows minimal replication steps, in a nodejs application: https://stackblitz.com/edit/node-wdg1xb?file=index.js
Heap performance profile of operation:
The text was updated successfully, but these errors were encountered: