Is it possible to log what Mendix garbage collection is deleting?

0
Hi there! I’m currently investigating a bug with our app, where a small list of NPE data (3 objects) is lost, if the user goes back and forth between two pages too many times. I have a hunch it might be the mendix garbage collection treating them as unused and deleting them. Is there a way to view in the logs, or anywhere else, what Mendix is clearing out as part of this process to be sure? I’ve seen documentation/forum comments explaining that linking NPEs to the session is a recommended workaround for garbage collection, which seems to fix the issue i’m seeing so that makes me more confident it is this, but I’d still like to be 100% if possible. Cheers Luke
asked
4 answers
0

No, for Mendix developers this is not possible. But, if you are right, then it is also not your problem to solve since garbage collection is the task of the MBS, Mendix Business Server, which is maintained by Mendix. Best thing to do therefore is creating an application in which you can reproduce this behaviour (or copy your current project, strip it from things not related to this problem) and create a support ticket.

 

answered
0

Hi Luke,

I had seen a similar behaviour in one of the apps, and I verified it, although it was in a different version of Mendix. I don't recall if it was just browser back or closing the page and I'm not sure if you're closing the page or not though.

It seems that Mendix garbage collection also runs when you close pages (too many times). See their official documentation:

https://docs.mendix.com/refguide/transient-objects-garbage-collecting

answered
0

You can dump the client state with CTRL+ALT+G as discussed here.

It sounds like your reasoning is also correct – see 3.1.1 and 3.1.2 here.

answered
0

You can also enable a special setting to see which objects are removed when garbage collections occur.

dojoConfig = {  data: {    "logCleanupStatistics": true  },  ...}

enable debug logs in browser console.

Example:  [Client] Garbage collecting 7 of 7  System.HttpHeader: 6473924464401166, 6473924464401171, 6473924464401170, 6473924464401169, 6473924464401168, 6473924464401167  System.HttpMessage: 8444249301321588

https://www.mendix.com/blog/the-art-of-state-part-2-garbage-collection/

 

answered