The server has 64gb RAM and the problem even occurs even with much
smaller -Xmx (tested with 6g). The java program logs this issue:
'Exception in thread "StartNextJob" java.lang.OutOfMemoryError: unable
to create new native thread' - but as I've mentioned, this only happens
if the program is started by crontab.

The java program creates many threads (1500 at startup, more afterwards)
and it always begins to hang just after 475 threads have been created.
So maybe it's more something like "OutOfThreads" even OutOfMemory is
logged.

The crontab of my local user only starts a simple perl script:
*/2 *    * * *    /home/dob/getjob/getjob.pl > /dev/null 2>&1

The script (getjob.pl) itself creates some config files and finally starts the 
java program by calling a shell script like this:
system('JAVA_OPTS="-Xmx6g -Xms6g" /home/dob/prog/bin/start');

Starting "/home/dob/getjob/getjob.pl" on SHELL with user 'dob'
everything is fine. Placing the line above in dob's crontab ("crontab
-e") the java program fails with 'Exception in thread "StartNextJob"
java.lang.OutOfMemoryError: unable to create new native thread' after
creating 475 threads.

I tried to start getjob.pl by root's crontab, but with same results. For
testing purpose I reduced the number of initial threads to 450 and with
this setting everything works fine for some minutes (until more threads
should be created). However I really need those 1500+ threads and I have
no clue why this isn't possible when the java program has been started
by crontab.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1582692

Title:
  OOM using CRON but not using SHELL under 16.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cron/+bug/1582692/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to