[BUG] Excessive memory usage - possible memory leak
Environment
Please provide as many details as you can:
- Hosting type
- [x] Local deployment
- Version: 1.75
- [x] Local deployment
Steps to Reproduce
- Retrieve forms and create new submissions multiple times. Over time the memory usage climbs to excessive levels.
Expected behavior
Form.io should be able to operate as a Kubernetes pod with a memory limit of 500MB.
Observed behavior
Form.io crashes when running as a Kubernetes pod with a memory limit of 500MB.
Initializing API Server.
> Mongo connection established.
> Serving the Form.io API Platform at <our_site>
<--- Last few GCs --->
[1:0x564fedf09220] 25239837 ms: Mark-sweep 253.1 (257.3) -> 252.2 (257.3) MB, 1098.3 / 0.0 ms (average mu = 0.282, current mu = 0.213) allocation failure scavenge might not succeed
[1:0x564fedf09220] 25241125 ms: Mark-sweep 253.0 (257.3) -> 252.1 (257.3) MB, 1208.5 / 0.0 ms (average mu = 0.183, current mu = 0.062) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x564feab7bd59]
Security context: 0x218c6b4408d1 <JSObject>
1: evalContext [0x28e0e6442f51] [/.npm-packages/node_modules/formiojs/Element.js:~627] [pc=0x1132864499f0](this=0x11191e23bd41 <Element map = 0x3b58d36c9df9>,0x2375e50416d9 <Object map = 0x2a97df73ff49>)
2: evalContext [0x28e0e645fec1] [/.npm-packages/node_modules/formiojs/components/_classes/component/Component.js:~1357] [pc=0x1132864d78a5](this=0x1...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

This is an issue we should investigate. I will make sure it makes it onto our planning for monday to get prioritized.
@travist Hello have there been any updates on this? We're still having periodic crashes as our pods run out of memory.
This has been deemed a priority and is on our list for starting next week. I would say you can look for a resolution within the next 3 weeks.
@travist Any updates on this issue?
@mikeyjkmo,
This item has been resourced. We will let you know once this issue has been resolved.
Thank you.
@travist Any updates on this issue? I saw that a fix to a memory leak on the core renderer was merged. Is that change related to this?
This is still on one of our developer's list. We will let you know once this issue is resolved.
Should be resolved with #1108