• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Thread is terminating  RSS feed

 
Hara Prasad Pradhan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Below code is running in background in unix server to archive the logs . Two shell scripts are called within the program to do so:



Above code is is executing properly, but terminates after 3-4 hrs. Kindly help me out..
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what happens when it terminates?
Any errors?
 
Hara Prasad Pradhan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It terminates without showing any error in log file logarchive.log.
As I am running this in unix environment, is it related to any resource utilisation issue or any OS level problem??
I dont think its a heap memory issue...
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to your post. Always use the tags: doesn't it look better now
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code

is very badly flawed since it throws away all the diagnostic information available from the process return codee, stdout and stderr.

You need to read all the sections of http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html and implement ALL the recommendations. You might then be in a position to diagnose the problem yourself.

P.S. The sleep() should not be necessary if you wait for the processes to terminate.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!