开发者

If I leave my Java program on overnight, i get an abnormal process termination error in java.exe

开发者 https://www.devze.com 2022-12-25 00:11 出处:网络
This is a tad c开发者_如何学编程omplicated of an issue with very little information I can provide so please bear with me or ignore.

This is a tad c开发者_如何学编程omplicated of an issue with very little information I can provide so please bear with me or ignore.

I am developing a small Swing/JOGL program and am attempting to include a java runtime within my program so that I can simplify JVM setup for my user. My program is being run off a batch file which calls my packaged java.exe which in turn, executes my jar files.

The program runs fine for several hours at which point it exits with a "Microsoft Visual C++ Runtime Library" Error:

   Runtime Error!
   Program: \<path>\java.exe

   abnormal program termination

My questions are:

  1. Is including a JRE as a folder in my program a "correct" solution to my problem i.e. insuring a stable and consistant JVM from which to run my program? Would it better to simply force my user to install Java first?

  2. By simply including the bin folder of a jre build for my platform, am I facing any sort of configuration issue? Is there a way to store configuration info other than using command line options when executing java.exe?

  3. By virtue of the C++ error message and the conditions by which abnormal process termination errors happen, I'm guessing it has to do with my JOGL library, however, the program works completely fine right up until the APT, and when using the exact same version of Java using the online installer, the program works completely fine without errors.

  4. Could this be something much more basic? Is it possible I'm simply not garbage collecting correctly or do not have GC configurations set correctly since I'm just using the bin folder of a JRE install?


Given that it takes overnight, the most likely culprit is either a memory leak or something that mucks with the video driver.

Check that the video driver and DirectX is up to date. Microsoft Automatic Updates is not enough! You need to check the vendor's site for the video drivers and Microsoft's site for DirectX.

If that doesn't fix it, it may be a memory leak.

Start your application.
Start VisualVm. It in the jdb/bin directory under the name jvisualvm.exe.
Note: these must be running as the same user

Your application should appear under the Local branch under applications.
Right click and choose Enable Heap Dump on OOME.
Right click and choose Open.
Now examine the Monitor tab.

Once your app is up an running, the heap and threads should stabilize and appear as a mostly straight line with a periodic sawtooth as tasks are processed and GC is performed.

However, if either of these lines is trending upward you have a problem.

There are also controls for taking heap and thread dumps that can be examined in more detail.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号