Java VM parameter set default native stack size setting

Source: Internet
Author: User

Summary of issues:

The program stack is too small, the stack size of the 64-bit machine is larger by default than 32 bits, the program from 64 to 32 execution error, need to modify the initial stack size

(. So library provides two function interfaces, one using a larger image, the other processing image is very small, only call the previous function will overflow)

Prior to using JNI in the Hadoop program to invoke the C-written (libxxx.so) local library, on the start of the machine (64-bit Ubuntu) to run normally, but copied to another (32-bit Ubuntu) cluster

Operation always error:

A irrecoverable stack overflow has occurred.
Please check the If any of the your loaded. So files have the enabled executable stack (see Mans page Execstack (8))
# A Fatal error has been detected by the Java Runtime environment:
# JRE Version:java (TM) SE Runtime Environment (7.0_71-B14) (build 1.7.0_71-b14)
# Java Vm:java HotSpot (TM) Server VM (24.71-b01 mixed Mode linux-x86)
# Failed to write core dump. Core dumps has been disabled. To enable core dumping, try "ulimit-c unlimited" before starting Java again

The errors identified in eclipse are mainly 3 points:

    • libxxx.so Library Stack Overflow
    • It is recommended to use Execstack settings under Linux libxxx.so need to run stack
    • Core dump is forbidden and recommended Ulimit-c Unlimited

First guess is whether the. so file does not have the Execute permission added:

So sudo chmod a+x, but found still not.

Then follow the error message from the back to the Internet to search for some solutions:

1. With regard to ulimit:http://www.cnblogs.com/leaven/archive/2011/04/22/2024539.html,Ulimit-c Unlimited was found to be useless after the setup.

2. For Execstack, you will need to install the sudo apt-get install execstack First:

The libxxx.so, which was compiled by the Jni method, was originally

-/usr/lib/libtest.so

The discovery file does not have the execute stack set so: Execstack-s/usr/lib/libtest.so

But still no effect, the program still error.

3. Finally, focus on setting the stack size allocated for the Java VM Virtual machine:

Read several pages about VM parameter settings:

    • (Various detailed parameters) http://developer.51cto.com/art/200907/135160.htm
    • (referred to the 64-bit machine >32-bit machine) http://www.blogjava.net/chenhui7502/archive/2011/08/18/356755.html
    • (Parameters successfully set in Eclipse) http://www.cnblogs.com/fantiantian/p/3658489.html
    • http://blog.csdn.net/cutesource/article/details/8244250

Use the method in the first: java-xss512k The command execution is always unsuccessful. The parameters of the VM are set directly in the Run->run configurations in eclipse according to the method in 3rd:

Ok!

Java VM parameter set default native stack size setting

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.