File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Complete Stall on Closing Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Complete Stall on Closing Application" Watch "Complete Stall on Closing Application" New topic
Author

Complete Stall on Closing Application

Stewart Griffin
Greenhorn

Joined: Dec 02, 2002
Posts: 23
I have, what seems like a major problem.
My java program runs perfectly but when I attempt to close the frame the computer stalls indefinitely.
I thought there was something wrong with my program but it was happening with other java programs i got off the net.
I then thought it the JVM but i uninstalled it and then re-installed it and the same problems remained.
Has anyone ever experienced this or does anyone has any ideas?
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
It would help to know the OS and Java versions.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
For instance:
# The following problems can occur intermittently on multi-processor systems. No workaround exists for these problems; the Linux system must be upgraded to eliminate them. No patch is currently available for Linux on 64-bit Itanium systems. However, using only one processor on an Itanium system will avoid these problems.
* A glibc 2.2 bug in versions 2.2.4 and earlier can cause the virtual machine to hang on exit when there is only one remaining active thread. This problem can affect Linux platforms such as Red Hat 7.0, 7.1, and 7.2 that have glibc versions 2.2 to 2.2.4. The problem is fixed in glibc 2.2.5. See bug report 4656697.
* The Linux 2.4 SMP kernel sometimes issues duplicate PIDs, which can lead to anything from network errors to crashes. This problem is fixed in kernel 2.4.18. See bug reports 4650839 and 4682743.
* An apparent bug in the Linux 2.4.9 kernel can sometimes cause an application running on the Java platform to occupy essentially all CPU resources, causing the application to hang. This problem is being tracked in bug report 4701394.
Stewart Griffin
Greenhorn

Joined: Dec 02, 2002
Posts: 23
I'm using Java 1.4.1 and the OS is Windows 2000
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
when I attempt to close the frame

Exactly HOW are you attempting to close the frame. Some code please.
And are you releasing all of the underlying resources such as streams etc.
[ February 27, 2003: Message edited by: Cindy Glass ]

"JavaRanch, where the deer and the Certified play" - David O'Meara
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Cindy, Stewart says "it was happening with other java programs i got off the net" so it could be a weird problem. I have got Win 2000/Java 1.4.1 too, but have encounted no such problems.
Stewart, what other programs have you been experiencing the problem with? Is it a hang, or is it the java.exe in a tight loop? Have you tried checking the cpu activity with the Task Manager (ctrl-alt-delete).
Cheers - Barry
Stewart Griffin
Greenhorn

Joined: Dec 02, 2002
Posts: 23
I've tried viewing the task manager before and after i attempt to close the app.
It still doesnt give any clear indications as to what exactly is happening.
The stall occurs when i make any attempt to close the application. I use the following code when i'm closing the app......

At this stage i've run completely out of ideas.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You could install j2sdk1.3.1_X and experiment a bit with that. A retrograde step, I know, but it may help pinpoint the problem.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Have you tried removing the System.gc() call?
You are not depending on finalizers are you?
-Barry
Stewart Griffin
Greenhorn

Joined: Dec 02, 2002
Posts: 23
Originally the call for the garbage collector wasn't there.
I was just trying something.
It obviously made no difference.
I really dont think its the java program because i've tried running other established java programs such as ArgoUML and that prog also causes the comp to crash when i close it.
I'm not sure what you are talking about when you mention finalisers?
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Finializers are methods added to classes which free up resources other than memory (sockets, files, pipes, et.c) when the objects get garbage collected. Or rather if the objects get garbage collected. Your call to System.gc() triggered that off. But because garbage collection may not happen the finializers may not get called. If you don't know what they are no matter - they are bothersome and not recommended to be used.
Sorry, I can only suggest a back switch to 1.3.1_X.
BTW Have you got latest Win 2000 service pack installed?
Stewart Griffin
Greenhorn

Joined: Dec 02, 2002
Posts: 23
Yeah I installed Service pack 3 about a week ago and it didn't seem to make any difference.
I'll try installing java 1.3.x but i might be using some methods that don't exist in 1.3, thus giving me a pile of errors and requiring a re-write.
The price i'll have to pay i guess.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I just loaded down argouml and it works fine.
Try writing the simplest itsy bitsy "HelloWorld" app closing a window the same way. If it hangs up, post it here and I'll try it on my box. Could even be display driver/directx related - crazy, but you never know.
-Barry
[ February 27, 2003: Message edited by: Barry Gaunt ]
Stewart Griffin
Greenhorn

Joined: Dec 02, 2002
Posts: 23
A simple prog will work no problem.
Problems seem to arise with larger java progs.
I've discounted my own program as a source of the problem cause it's not only my program thats stalling.
Another possibility is that its my program thats has somehow corrupted the system, but i cant see how that could happen.
At this stage i think the only answer is to strip the comp and re-install windows 2000. At least i'll know for sure if it my application thats the prob or not.
It might be a bit drastic though.
I'll tell you about the outcome and maybe i'll have some answers in the near future!
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
There's some funny things going on here
Try out j2sdk1.4.0_03 before you go to 1.3.1_X
[ February 27, 2003: Message edited by: Barry Gaunt ]
Stewart Griffin
Greenhorn

Joined: Dec 02, 2002
Posts: 23
Yeah, what they're discussing sounds simular to my problem but most of there problems involve sun one, mine doesn't.
If worst comes to worst, and i cant solve it, i'll just have to make sure i dont try and close my application on demo day!!
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
A coworker of mine had a similar problem and fixed it by updating his ATI video driver...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Complete Stall on Closing Application
 
Similar Threads
Downloading and Executing a Java Prog from a URL
An Outdated Exam Package?
A de-five-izer
MySQL Error - no driver
Performance issue between C++ and Java on reading Large binary files