formio icon indicating copy to clipboard operation
formio copied to clipboard

[BUG] Excessive memory usage - possible memory leak

Open mikeyjkmo opened this issue 5 years ago • 8 comments

Environment

Please provide as many details as you can:

  • Hosting type
    • [x] Local deployment
      • Version: 1.75

Steps to Reproduce

  1. 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

image

mikeyjkmo avatar Jun 02 '20 11:06 mikeyjkmo

This is an issue we should investigate. I will make sure it makes it onto our planning for monday to get prioritized.

travist avatar Jun 02 '20 14:06 travist

@travist Hello have there been any updates on this? We're still having periodic crashes as our pods run out of memory.

mikeyjkmo avatar Jun 08 '20 16:06 mikeyjkmo

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 avatar Jun 08 '20 16:06 travist

@travist Any updates on this issue?

mikeyjkmo avatar Jun 26 '20 10:06 mikeyjkmo

@mikeyjkmo,

This item has been resourced. We will let you know once this issue has been resolved.

Thank you.

wag110894 avatar Jun 26 '20 13:06 wag110894

@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?

mikeyjkmo avatar Sep 30 '20 10:09 mikeyjkmo

This is still on one of our developer's list. We will let you know once this issue is resolved.

wag110894 avatar Sep 30 '20 14:09 wag110894

Should be resolved with #1108

roflanKisel avatar Nov 11 '20 14:11 roflanKisel