JNI library and Heap memory

S

Saptarshi

Hello,
I'll try to be precise. Do the memory allocations in the c -library
(called by System.load) use up the Java heap memory? If my -Xmx is 8GB
then are memory allocations of the c -library memory calls limited to
this or can it use up as memory there is on the system(in this case
32GB).

Thanks
Saptarshi
 
A

Arne Vajhøj

Saptarshi said:
I'll try to be precise. Do the memory allocations in the c -library
(called by System.load) use up the Java heap memory? If my -Xmx is 8GB
then are memory allocations of the c -library memory calls limited to
this or can it use up as memory there is on the system(in this case
32GB).

Regular new/malloc calls should not be limited by Xmx.

Various NewXxxx call should be limited by Xmx.

Arne
 
S

Saptarshi

Regular new/malloc calls should not be limited by Xmx.

Various NewXxxx call should be limited by Xmx.

Arne

hmm, thank you. My next question, is there a way to limit memory
returned to new/malloc calls? The library can eat up all the memory,
bringing the system to a crawl. I would like to use -Xmx and some
limit to control the max memory the java code and it's loaded
libraries can use.
Is this possible?
 
A

Arne Vajhøj

Saptarshi said:
hmm, thank you. My next question, is there a way to limit memory
returned to new/malloc calls? The library can eat up all the memory,
bringing the system to a crawl. I would like to use -Xmx and some
limit to control the max memory the java code and it's loaded
libraries can use.
Is this possible?

It may be possible.

It will be operating system/compiler specific.

Arne
 
T

Tom Anderson

hmm, thank you. My next question, is there a way to limit memory
returned to new/malloc calls? The library can eat up all the memory,
bringing the system to a crawl. I would like to use -Xmx and some limit
to control the max memory the java code and it's loaded libraries can
use. Is this possible?

On unix, use ulimit.

On other platforms, install unix, and then use ulimit.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top