Join the DZone community and get the full member experience.
Join For Free
Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!
The following question is quite common and is related to
OutOfMemoryError: unable to create new native thread
problems during the JVM thread creation process and the JVM thread capacity.
This is also a typical interview question I ask to new technical candidates (senior role). I recommend that you attempt to provide your own response before looking at the answer.
Why can’t you increase the JVM thread capacity (total # of threads) by expanding the Java heap space capacity via -Xmx?
The Java thread creation process requires native memory to be available for the JVM process. Expanding the Java heap space via the –Xmx argument will actually reduce your Java thread capacity since this memory will be “stolen” from the native memory space.
- For a 32-bit JVM, the Java heap space is in a race with the native heap, including the thread capacity
- For a 64-bit JVM, the thread capacity will mainly depend of your OS physical & virtual memory availability along with your current OS process related tuning parameters
In order to better understand this limitation, I now propose to you the following video tutorial.
Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.
Published at DZone with permission
Pierre - Hugues Charbonneau
, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.