Java applet not fully updated

I worked on a game that played in a java applet. Everything works fine until you try to refresh the page. It often seems that he β€œstores” the applet that he has used so far and resumes the game in the same applet. A new process is not created, and the use of the plunger increases (~ 250 mb instead of ~ 140 mb), and the same console is used for the applet. The drawing process is also quite backward; it often skips about 0.5 seconds of frames before re-drawing.

It only occasionally completely updates the applet; a new process is created (as seen from the Windows task manager), a new console opens, it uses less bar; it starts from scratch again.

Since I am having trouble reusing the applet, I would like to force it to create a new process every time I update. Is there any way to do this? Or can I somehow fix the problems when it is not fully updated?

The game I'm working on can be seen at http://patrickdev.nl/galaxy048/ . After starting, press "f" to switch the fps and memory data.

Thanks in advance.

+4
source share
1 answer

Applets support a parameter that forces it to run the applet in the new jvm. This also works after refreshing the page, and exactly what I was looking for - it starts from scratch. Just add this parameter to your applet tag:

<param name="separate_jvm" value="true" />

Additional information at http://www.oracle.com/technetwork/java/javase/plugin2-142482.html#SEPARATE_JVM

+3
source

Source: https://habr.com/ru/post/1445513/


All Articles