• Post Reply Bookmark Topic Watch Topic
  • New Topic

ExecutorService  RSS feed

 
Timmy Ryan
Ranch Hand
Posts: 63
IntelliJ IDE Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program which creates an ExecutorService object with Executors.newSingleThreadScheduledExecutor()
I then submit two jobs to this using scheduleWithFixedDelay method.
The first task checks some value in the registry using com.ice.jni.registry and the second runs some commands with commons.exec

If I run the program with the two jobs together if freezes after about two cycles.
If I run the program with either of the jobs running on there own the program runs fine.
There is no common code between the two jobs.

How do I go about debugging this problem?

If I create another thread which is separate to the ExecutorService it stops running as well when the ExecutorService freezes.
 
Aditya Jha
Ranch Hand
Posts: 227
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Run it on Debug mode in some IDE like Eclipse. Then, once the application is frozen (as reported in your comment), pause the relevant threads and check their call stack. This should give you an idea about any possible deadlocks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!