• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Thread is terminating

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic