Uncommited objects - Life cycle?

0
Hi, I have a question, what will happen if we created a object in a microflow and we never commit it and end the microflow. will it still stay in the mendix runtime memory? or it will be garbage collected when microflow transaction is completed.    Could some one please help me with above question? Thanks in advance
asked
2 answers
1

Your not-commited objects are elligable for garbage collection by the JVM runtime's garbage collector: Java Memory Usage | Mendix Documentation

The situation can be a bit more complex when taking the client state into account: Non-Persistable Objects and Garbage Collecting | Mendix Documentation

answered
1

Depends, if it is "in scope" after the microflow

 

  1. When an object is created and not returned to a page it will be garbage collected
  2. When it is send to a page it will be kept in scope and not garbage collected: datasource microflow, show page parameter
  3. When you use it in your own created Java action which retains the object, but never releases it will be kept in scope and not (never) garbage collected

Never rely on default garbage collection when you can delete the object before the end of the microflow. Stay in control is my adagium 

 

answered