Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is memory allocated in JNA (or JNI) by the C code limited by jvm (param -Xmx or architecture 32/64)

Tags:

java

memory

jvm

jna

that is, could a malloc() asking for 5 mb in the C part fail due to:

  • jvm was run with -Xmx32m and jvm heap is already 30 mb
  • something to do with jvm being 32 bits in a 64 bits windows
like image 628
Persimmonium Avatar asked Mar 25 '10 18:03

Persimmonium


1 Answers

The answer to the the first bullet is "no" - Xmx refers to the Java heap and any native allocations are completely separate.

The answer to the second bullet is "yes" - native allocations are subject to the general process allocation restrictions inherent in the O/S and/or hardware.

like image 132
Lawrence Dol Avatar answered Sep 28 '22 16:09

Lawrence Dol