Memory issues on display resize

HI All,

I've got an application in a client space that is having some strange memory errors. In the end the application crashes with a windows error to "Close programs to prevent information loss. Your computer is low on memory. Save your files and close these programs: Java(TM) Platform SE binary"

The application runs flawlessly for weeks in our studio, but once installed with their monitors and network, this error occurs once every few days. I feel like is something to do with the monitor cables they are using as it is a hodgepodge of adapters and cables that just looks like a problem waiting to happen. That is also the biggest difference in the setups from our office and their installation.

I've set the starting heap to 2GB and the max heap to 4GB and the computer has 12GB of memory installed so it should have plenty of overhead. In our environment and 90% of the time it is in their environment the entire app uses around 2.6GB of memory (fluctuating when playing a video, but is then garbage collected effectively).

My best guess, and the only way we have been able to come close to reproducing it, is that the video cables are faulty and causing windows to re-position the screens, and that somehow causes it to lose reference to some memory. I have been able to reproduce this twice, but the app recovers each time. I unplug and re-plug a cable, and the memory spikes twice, but then levels back off. In one case it didn't level back off and remained at 95% of the system's memory. So it seems clear that their cable setup is causing the issue, but ideally the application could recover from this issue without crashing.

It's a pretty massive program with quite a few confidential dependancies so I can't really post the code here unfortunately. I can share this demo video we made of it running to give you an idea of what it's doing:

(pass: goldfish)

Any thoughts on what I could try? Need some more information? Again, sorry for the no code...

Thanks! ak



  • This is going to be pretty hard for us to debug.

    If you can't post the whole project (and you shouldn't anyway, as it's too much for us to debug), try narrowing it down to an MCVE - the bare minimum amount of code that reproduces the error.

    Do other programs cause this error on your client machine?

    You could also use the task manager to figure out what exactly is taking up all the memory on the client machine. Honestly it doesn't sound like it's your program at all- Java will run out of memory before the system it's running on does, unless other stuff is going on behind the scenes.

  • Woah, hey, sorry for the very delayed response...

    It's a pretty hard issue to even identify because it only happens once (maybe) every few weeks, and sometimes can be reproduced with the hardware fiddling like I mentioned.

    I've used task manager, as well as the more detailed system profiler and VisualVM to try to pin down exactly what's happening, which is how I found that it is in fact Java that is reporting very high memory usage. My app is capped at 4GB, but it's likely that the Catalyst Control Center is also using Java as its underlying codebase, so that would also report as Java, but I would think it would be a separate instance.

    Thanks for the response Kevin, Seems to be a mystery and we've put it back in the client's court since the cabling seems to be the core of the issue.


  • The issue I have is that your Java program should run out of memory before Java itself takes up 90% of your system's memory. I wonder if you have a hardware issue here?

    What happens if you create a little test program that just creates bigger and bigger arrays? Try giving that program 2gigs of memory and see what happens.

  • Hmm, good idea, I'll give it a shot!

Sign In or Register to comment.