Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Complete Stall on Closing Application

 
Stewart Griffin
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would help to know the OS and Java versions.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Java 1.4.1 and the OS is Windows 2000
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried removing the System.gc() call?
You are not depending on finalizers are you?
-Barry
 
Stewart Griffin
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A coworker of mine had a similar problem and fixed it by updating his ATI video driver...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic