Add new “purge” action to the toolkit of Mendix. - Mendix Forum

Add new “purge” action to the toolkit of Mendix.


Within the following example you will see that I have created a specific JAVA action to purge a certain used list of objects within a microflow from the JVM memory.
This is basicly the standard “Delete” behavior of Mendix, but without the execution of the Delete query.
On top of that the standard JAVA functionality “Runtime.getRuntime.gc()” is used to ask the garbage collection,
when possible, to remove the deleted objects from memory.

This does not effect standard Mendix behavior, as far as we can tell.
As an incredible effect, we see an astonishing positive result in memory usage of memory in the JVM.
And are wondering if it would be possible to get this extra functionality to “purge” an object or list of objects from memory
as a standard feature within the toolkit.

To visualize my point, take a look at the following image.
1. is the JAVA action (really small codebase)
2. Placing the JAVA action at the right location within the microflow (simply where you should put delete).
3. A print of the JVM with “visualvm” where you see a perfectly steady JVM – Heap Space behavior.

0 answers