what can be the reason for the freezing java app (a game made by JME3)?
my game some times crashed and froze. I don’t know why.
maybe because of processing a large navmesh (but every time it works well and some times froze)?
or because of the need for more memory?
Is it a crash or a freeze? Those are technically different things.
In the case that it is freezing without any errors or stack trace, then you may have accidentally put an unbreakable infinite loop somewhere in your code.
Sounds like an infinite loop. I don’t know which IDE you use, but in Eclipse you can run your game in debug mode. When it freezes, you can pause each thread on by another in the debug view. Then you will be able to see where your threads are in the code.
Please provide further details. Every single point is important for us. It could be anything… a deadlock, an infinite loop, a GPU driver crash, a GPU device failure…
Use VisualVM or jProfiler to analyze your threads when it freezes. Or can’t you see anything because your screen is black and you need to reset your PC? A frozen/black screen, but the sound is still playing is a sign of a GPU/PSU hardware failure.
no, the last frame of the scene is showing there, the mouse pointer can move but not work in-game nothing cant select, keyboard not working. just plays sound. and CPU usage increase fan speed.
I tried it on another computer, os, and different hardware.
This only works if you run from the command line. Then when your app locks up you have to switch to the command line window and hit ctrl-break.
From your other posts, it does sound like you have an infinite loop somewhere in your code where it just runs and runs in a circle using 100% CPU. So another approach would be to comment things out to see if things start working again.
Wow, for all the years I have been programming Java, I never knew this! Just tested on one of my apps, this works great. I will have to add this to my mental tool box.
I tried with another java program, it’s not working at all.
java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)