简体   繁体   中英

Java application inconsistent state

I find my entire application messed up. First log got mingled up . Application seems to be freezing after every regular interval,freezing for almost half a minute after every minute or so.The regular threads which performs majority of task seems to have got lost and they have no traces of theirs.All these are drawn up from the logging. Socket seems to had hanged up as per report of the user.

Still very little clue, what had triggered all these. CPU usage record shows everything fine at that time. As I'm left to guess,can you point out a starting point or any particular instance escaping my mind,hitting which I can decrypt possible reason for all these mess.

Thanks, Mawia

I experienced such behavior when running java application that uses GC very intensively on virtual box with limited memory. The guest OS did not have enough "physical" memory so it used swap memory. But the swap was on "virtual" disk mapped to the physical disk of host OS.

When java GC running on guest OS started working it had to remove garbage from heap that actually was located on physical disk of host OS.

I do not want to say that your situation is identical but probably it is similar. So, try to check how much physical memory you have and how often is your GC running and how much memory is it attempting to clear. You gave 1GB to your JVM. Do you have enough physical memory? Probably your JVM heap is actually located in OS swap memory, ie on disk?

Try to investigate your application. Is there a chance it allocates huge memory and cleans it too often? Is it possible to use cache etc? Check how much memory is used by perm gen and how my by short-living objects.

Why don't you try attaching to your program with a sample based monitoring tool and see what the threads and the JVM subsystem are doing? JVisualVM ships with the JDK and it's easy to use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM