Engine takes up too much memory
gitchen2017 opened this issue · 10 comments
Every time I initiate a process, it takes up 30m of memory,
Is it released when the execution completes?
Although, if 30m is Mbytes? IMHO its not that much. Usually node breaks at 1024MB unless you run with --max-old-space-size
.
Have you tried running with DEBUG=bpmn* node app.js
? If you have an infinite loop it would cause abundant logging.
@gitchen2017 any progress?
30m sounds great, especially for a server side service. Java, sitting idle takes at least 6 times that on a good day, before it even does anything. I realize we're talking about JavaScript, but by way of comparison, 30m is quite good. Compare that even to Rust or Go, which handle memory well (Rust extremely well), and the trivial Fibonacci test takes nearly 30m. See this article for comparisons https://medium.com/@dexterdarwich/comparison-between-java-go-and-rust-fdb21bd5fb7c#:~:text=Both%20Go%20and%20Rust%20utilized,memory%20than%20Go%20and%20Rust.
An application with significant functionality, like this one, can reasonably take that much memory.
What's your email address
I have multiple BPMN files. Launching a BPMN file is an instance. In this case, do you want to create more than one bpmnengine or just one new one?
I would go for one engine per BPMN diagram.
@gitchen2017, you were in to something here. Try out the new version. Sorry for discarding this issue too soon.
Is it released when the execution completes?
@paed01 Hi, is there any reference for memory releasing?
Not sure what you mean by reference? There are lots of tests that make sure no timers or events are lingering when execution is complete.
I have tried to reduce the footprint of the engine. The worst culprit was smqp. When prototyping the package it is less CPU- and GC intense. Then I went on prototyping bpmn-elements which further reduced CPU and GC.