Results 1 to 3 of 3

Thread: Program hangs

  1. #1
    yuliada is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Default Program hangs

    Hello

    I have a Java program which sometimes works OK untill the very end, but sometimes just hangs in a random moment and doesn't react to Ctrl+C or Ctrl+Break. Process doesn't use CPU, so I guess it isn't something like infinite loop (I actually cannot think of places in my program where this kind of loop may occur). I tried to get thread dump to see if there are any deadlocks, but Ctrl+Break doesn't work and jstack doesn't work also (I've read that there is -F option, but it isn't available on Windows). Also I tried to connect to a hanged process with Java Visual VM - doesn't help too (just says 'Connecting...' forever).

    I tried to start my program, connect with Java Visual VM to it at the beginning and see how threads visualisation will look like in a moment when program hangs. My programm died after about 50 min and all info which I was able to see was about this period of time (e.g. a timeline diagram stopped changing and the last time mark was 49:23), but Java Visual VM was still connected to a process. I pressed Thread Dump button, it worked, but there was nothing 'criminal' on the dump it provided. So I guess maybe it is not actual thread dump, it is something that Java Visual VM was able to get before process hanged.

    What else can I do to find out what's going on in my programm and fix it?
    I tried to run it with JDK 1.6.0_07 and 1.6.0_16. I'm using Windows Vista Enterprise SP1, 64-bit.

    Thanks in advance, Yulia.
    Last edited by yuliada; 10-27-2009 at 10:08 PM.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default

    Sprinkle some System.out.println( ... ) statements in the busiest parts of your program, let it run and see what happens ...

    kind regards,

    Jos

  3. #3
    yuliada is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    Sprinkle some System.out.println( ... ) statements in the busiest parts of your program, let it run and see what happens ...

    kind regards,

    Jos
    Tried it, but still can't figure out why it hangs. I've builded my programm on JDK 1.5 instead of 1.6 and have been using it for 2 weeks - no hangs so far... Hope it will keep working this way :)

Similar Threads

  1. Applet hangs while using JOptionPane.xxx()
    By Basit in forum Java Applets
    Replies: 3
    Last Post: 08-08-2009, 06:18 PM
  2. Discussion: JVM hangs
    By Arica in forum Advanced Java
    Replies: 5
    Last Post: 06-29-2009, 04:29 AM
  3. java mail hangs
    By ashwinkumar18 in forum Advanced Java
    Replies: 6
    Last Post: 03-14-2009, 10:38 AM
  4. [SOLVED] Multiple client single server problem(it hangs halfway)
    By kellaw in forum Threads and Synchronization
    Replies: 4
    Last Post: 10-03-2008, 07:41 PM
  5. Replies: 1
    Last Post: 10-02-2008, 07:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •