System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to create new native thread Error

viaml
Occasional Visitor

Unable to create new native thread Error

Hi

I am using HP-UX B.11.31 U ia64 3554308614 server.

We are getting the error when one of our java process is running
"java.lang.OutOfMemoryError: unable to create new native thread"

Could someone please advise why this error is occurring.

We have allocated 2Gb heap size for the java process, thread stack size is 256KB

Could you also let us know the correct formula for the thread stack size, heap size that we should configure.

Below listed are existing kernel parameters:

aio_proc_thread_pct 70 Default Immed
aio_proc_threads 1024 Default Immed
aio_req_per_thread 1 Default Immed
max_thread_proc 4096 4096 Immed
nfs2_max_threads 8 Default Immed
nfs3_max_threads 8 Default Immed
nfs4_max_threads 8 Default Immed
nkthread 52516 52516 Immed
sched_thread_affinity 6 Default Immed
vx_era_nthreads 5 Default
maxssiz 134217728 134217728 Immed
maxssiz_64bit 1073741824 1073741824 Immed
pa_maxssiz_32bit 83648512 Default Immed
pa_maxssiz_64bit 536870912 Default Immed

Please let me know in case you need any other information.

Thanks,
Vimal
3 REPLIES
Horia Chirculescu
Honored Contributor

Re: Unable to create new native thread Error

Hello,

Try to lower heap size for java processes, leaving more memory for native threads.

Do you have more than 4G of memory installed on your system?

Best regards,
Horia.
Best regards from Romania,
Horia.
Alzhy
Honored Contributor

Re: Unable to create new native thread Error

If you have "Glance" -- please verify that you are not running out of threads per proc... if you are (most likely you are as Java can be very highly theraded) --- please incease:

max_thread_proc 4096 4096 Immed

(Note also your nkthread settings)

Hakuna Matata.
chindi
Respected Contributor

Re: Unable to create new native thread Error

Hi,

We are also getting same error.

We have 256Gb RAM , rx2800i4.

root #/ >sw
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 204800 0 204800 0% 0 - 1 /dev/vg00/lvol2
reserve - 155616 -155616
memory 249232 27319 221913 11%
total 454032 182935 271097 40% - 0 -

 

Tunable: nproc
Usage: 5088
Setting: 12288
Percentage: 41.4

 

Tunable: max_thread_proc
Usage: 148
Setting: 4000
Percentage: 3.7

Tunable: nkthread
Usage: 6795
Setting: 20000
Percentage: 34.0