32-bit Java environment


3 posts
by maybach57 » Thu Apr 27, 2017 4:34 am
Hi

I just got an RPi 3.

I tried to access a google Java API from the RPi, but the API supports only 64-bit libraries. It is necessary to build 32-bit objects ourselves. However, when I try to build a 32-bit object - specifically, I was trying to build net-tcnative-master for the RPi, I get an error
"There is insufficient memory for the Java Runtime Environment to continue."

My RPi has 1 GB RAM + 8 GB SD Flash. I have noticed that even running a browser takes a lot of memory.

It seems to me that this would be an oft-visited issue, but I could not find any references to this issue in the Forum/FAQ.


I am providing the error log below. Any help is much appreciated.



#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 179044352 bytes for committing reserved memory.
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (os_linux.cpp:2627), pid=3278, tid=1983288416
#
# JRE version: (8.0_65-b17) (build )
# Java VM: Java HotSpot(TM) Client VM (25.65-b01 mixed mode, sharing linux-arm )
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

--------------- T H R E A D ---------------

Current thread (0x76207400): JavaThread "Unknown thread" [_thread_in_vm, id=3281, stack(0x7631a000,0x7636a000)]

Stack: [0x7631a000,0x7636a000]

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )

Other Threads:

=>0x76207400 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=3281, stack(0x7631a000,0x7636a000)]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: None

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (0 events):
No events

Events (0 events):
No events


Dynamic libraries:
00008000-00009000 r-xp 00000000 b3:07 173336 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javac
00010000-00011000 rw-p 00000000 b3:07 173336 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javac
0046d000-0048e000 rw-p 00000000 00:00 0 [heap]
33dff000-33e2a000 rw-p 00000000 00:00 0
33e2a000-33fff000 ---p 00000000 00:00 0
33fff000-39540000 rw-p 00000000 00:00 0
39540000-49540000 ---p 00000000 00:00 0
54000000-74000000 ---p 00000000 00:00 0
740b0000-740b1000 rw-p 00000000 00:00 0
740b1000-74130000 ---p 00000000 00:00 0
74130000-74158000 rwxp 00000000 00:00 0
74158000-76130000 ---p 00000000 00:00 0
76130000-76147000 r-xp 00000000 b3:07 301272 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libzip.so
76147000-7614e000 ---p 00017000 b3:07 301272 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libzip.so
7614e000-7614f000 rw-p 00016000 b3:07 301272 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libzip.so
7614f000-7615a000 r-xp 00000000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
7615a000-76169000 ---p 0000b000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
76169000-7616a000 r--p 0000a000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
7616a000-7616b000 rw-p 0000b000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
7616b000-76174000 r-xp 00000000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76174000-76183000 ---p 00009000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76183000-76184000 r--p 00008000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76184000-76185000 rw-p 00009000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76185000-76196000 r-xp 00000000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
76196000-761a5000 ---p 00011000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
761a5000-761a6000 r--p 00010000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
761a6000-761a7000 rw-p 00011000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
761a7000-761a9000 rw-p 00000000 00:00 0
761a9000-761b0000 r-xp 00000000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761b0000-761bf000 ---p 00007000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761bf000-761c0000 r--p 00006000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761c0000-761c1000 rw-p 00007000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761d4000-761f7000 r-xp 00000000 b3:07 301246 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libjava.so
761f7000-761ff000 ---p 00023000 b3:07 301246 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libjava.so
761ff000-76200000 rw-p 00023000 b3:07 301246 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libjava.so
76200000-76221000 rw-p 00000000 00:00 0
76221000-76300000 ---p 00000000 00:00 0
76303000-76309000 r-xp 00000000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
76309000-76318000 ---p 00006000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
76318000-76319000 r--p 00005000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
76319000-7631a000 rw-p 00006000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
7631a000-7631d000 ---p 00000000 00:00 0
7631d000-7636a000 rwxp 00000000 00:00 0
7636a000-763d3000 r-xp 00000000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763d3000-763e3000 ---p 00069000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763e3000-763e4000 r--p 00069000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763e4000-763e5000 rw-p 0006a000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763e5000-76968000 r-xp 00000000 b3:07 301286 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/client/libjvm.so
76968000-76970000 ---p 00583000 b3:07 301286 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/client/libjvm.so
76970000-7699c000 rw-p 00583000 b3:07 301286 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/client/libjvm.so
7699c000-76dbf000 rw-p 00000000 00:00 0
76dbf000-76ddc000 r-xp 00000000 b3:07 306364 /lib/arm-linux-gnueabihf/libgcc_s.so.1
76ddc000-76deb000 ---p 0001d000 b3:07 306364 /lib/arm-linux-gnueabihf/libgcc_s.so.1
76deb000-76dec000 rw-p 0001c000 b3:07 306364 /lib/arm-linux-gnueabihf/libgcc_s.so.1
76dec000-76f17000 r-xp 00000000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f17000-76f27000 ---p 0012b000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f27000-76f29000 r--p 0012b000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f29000-76f2a000 rw-p 0012d000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f2a000-76f2d000 rw-p 00000000 00:00 0
76f2d000-76f2f000 r-xp 00000000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f2f000-76f3e000 ---p 00002000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f3e000-76f3f000 r--p 00001000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f3f000-76f40000 rw-p 00002000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f40000-76f54000 r-xp 00000000 b3:07 301431 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/arm/jli/libjli.so
76f54000-76f5c000 ---p 00014000 b3:07 301431 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/arm/jli/libjli.so
76f5c000-76f5d000 rw-p 00014000 b3:07 301431 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/arm/jli/libjli.so
76f5d000-76f71000 r-xp 00000000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f71000-76f81000 ---p 00014000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f81000-76f82000 r--p 00014000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f82000-76f83000 rw-p 00015000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f83000-76f85000 rw-p 00000000 00:00 0
76f86000-76f8f000 r-xp 00000000 b3:07 301271 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libverify.so
76f8f000-76f97000 ---p 00009000 b3:07 301271 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libverify.so
76f97000-76f98000 rw-p 00009000 b3:07 301271 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libverify.so
76f98000-76f9d000 r-xp 00000000 b3:07 18866 /usr/lib/arm-linux-gnueabihf/libarmmem.so
76f9d000-76fac000 ---p 00005000 b3:07 18866 /usr/lib/arm-linux-gnueabihf/libarmmem.so
76fac000-76fad000 rw-p 00004000 b3:07 18866 /usr/lib/arm-linux-gnueabihf/libarmmem.so
76fad000-76fcd000 r-xp 00000000 b3:07 306243 /lib/arm-linux-gnueabihf/ld-2.19.so
76fce000-76fd6000 rw-s 00000000 b3:07 25448 /tmp/hsperfdata_pi/3278
76fd6000-76fd7000 r--p 00000000 00:00 0
76fd7000-76fda000 rw-p 00000000 00:00 0
76fda000-76fdc000 rw-p 00000000 00:00 0
76fdc000-76fdd000 r--p 0001f000 b3:07 306243 /lib/arm-linux-gnueabihf/ld-2.19.so
76fdd000-76fde000 rw-p 00020000 b3:07 306243 /lib/arm-linux-gnueabihf/ld-2.19.so
7eadb000-7eafb000 rwxp 00000000 00:00 0 [stack]
7eafb000-7eafc000 rw-p 00000000 00:00 0
7ec39000-7ec3a000 r-xp 00000000 00:00 0 [sigpage]
7ec3a000-7ec3b000 r--p 00000000 00:00 0 [vvar]
7ec3b000-7ec3c000 r-xp 00000000 00:00 0 [vdso]
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]

VM Arguments:
jvm_args: -Dapplication.home=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt -Xms8m -Xmx1024m -Xms256m
java_command: com.sun.tools.javac.Main @/tmp/org.codehaus.plexus.compiler.javac.JavacCompiler6977397842974037963arguments
java_class_path (initial): /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/tools.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/classes
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/home/pi/apache-maven-3.5.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
SHELL=/bin/bash
DISPLAY=:0.0

Signal Handlers:
SIGSEGV: [libjvm.so+0x506638], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0x506638], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR2: [libjvm.so+0x3fd650], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none


--------------- S Y S T E M ---------------

OS:PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

uname:Linux 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l
libc:glibc 2.19 NPTL 2.19
rlimit: STACK 8192k, CORE 0k, NPROC 7336, NOFILE 65536, AS infinity
load average:2.59 1.36 0.67

/proc/meminfo:
MemTotal: 947732 kB
MemFree: 33420 kB
MemAvailable: 141108 kB
Buffers: 1804 kB
Cached: 373096 kB
SwapCached: 4964 kB
Active: 459912 kB
Inactive: 400892 kB
Active(anon): 362072 kB
Inactive(anon): 357640 kB
Active(file): 97840 kB
Inactive(file): 43252 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 102396 kB
SwapFree: 0 kB
Dirty: 420 kB
Writeback: 0 kB
AnonPages: 482192 kB
Mapped: 330956 kB
Shmem: 233756 kB
Slab: 27652 kB
SReclaimable: 15108 kB
SUnreclaim: 12544 kB
KernelStack: 2744 kB
PageTables: 10800 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 576260 kB
Committed_AS: 2995964 kB
VmallocTotal: 1114112 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
CmaTotal: 8192 kB
CmaFree: 3720 kB


CPU:total 4 (ARMv7), vfp

/proc/cpuinfo:
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : BCM2709
Revision : a22082
Serial : 0000000083582adf


Memory: 4k page, physical 947732k(33420k free), swap 102396k(0k free)

vm_info: Java HotSpot(TM) Client VM (25.65-b01) for linux-arm-vfp-hflt JRE (1.8.0_65-b17), built on Oct 6 2015 16:19:04 by "java_re" with gcc 4.7.2 20120910 (prerelease)

time: Wed Apr 26 16:38:17 2017
elapsed time: 0 seconds (0d 0h 0m 0s)
Posts: 2
Joined: Thu Apr 27, 2017 4:21 am
by jamesdev » Mon May 08, 2017 11:24 am
maybach57 wrote:Hi

I just got an RPi 3.

I tried to access a google Java API from the RPi, but the API supports only 64-bit libraries. It is necessary to build 32-bit objects ourselves. However, when I try to build a 32-bit object - specifically, I was trying to build net-tcnative-master for the RPi, I get an error
"There is insufficient memory for the Java Runtime Environment to continue."

My RPi has 1 GB RAM + 8 GB SD Flash. I have noticed that even running a browser takes a lot of memory.

It seems to me that this would be an oft-visited issue, but I could not find any references to this issue in the Forum/FAQ.


I am providing the error log below. Any help is much appreciated.



#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 179044352 bytes for committing reserved memory.
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (os_linux.cpp:2627), pid=3278, tid=1983288416
#
# JRE version: (8.0_65-b17) (build )
# Java VM: Java HotSpot(TM) Client VM (25.65-b01 mixed mode, sharing linux-arm )
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

--------------- T H R E A D ---------------

Current thread (0x76207400): JavaThread "Unknown thread" [_thread_in_vm, id=3281, stack(0x7631a000,0x7636a000)]

Stack: [0x7631a000,0x7636a000]

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )

Other Threads:

=>0x76207400 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=3281, stack(0x7631a000,0x7636a000)]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: None

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (0 events):
No events

Events (0 events):
No events


Dynamic libraries:
00008000-00009000 r-xp 00000000 b3:07 173336 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javac
00010000-00011000 rw-p 00000000 b3:07 173336 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javac
0046d000-0048e000 rw-p 00000000 00:00 0 [heap]
33dff000-33e2a000 rw-p 00000000 00:00 0
33e2a000-33fff000 ---p 00000000 00:00 0
33fff000-39540000 rw-p 00000000 00:00 0
39540000-49540000 ---p 00000000 00:00 0
54000000-74000000 ---p 00000000 00:00 0
740b0000-740b1000 rw-p 00000000 00:00 0
740b1000-74130000 ---p 00000000 00:00 0
74130000-74158000 rwxp 00000000 00:00 0
74158000-76130000 ---p 00000000 00:00 0
76130000-76147000 r-xp 00000000 b3:07 301272 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libzip.so
76147000-7614e000 ---p 00017000 b3:07 301272 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libzip.so
7614e000-7614f000 rw-p 00016000 b3:07 301272 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libzip.so
7614f000-7615a000 r-xp 00000000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
7615a000-76169000 ---p 0000b000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
76169000-7616a000 r--p 0000a000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
7616a000-7616b000 rw-p 0000b000 b3:07 306388 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
7616b000-76174000 r-xp 00000000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76174000-76183000 ---p 00009000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76183000-76184000 r--p 00008000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76184000-76185000 rw-p 00009000 b3:07 306249 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
76185000-76196000 r-xp 00000000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
76196000-761a5000 ---p 00011000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
761a5000-761a6000 r--p 00010000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
761a6000-761a7000 rw-p 00011000 b3:07 306324 /lib/arm-linux-gnueabihf/libnsl-2.19.so
761a7000-761a9000 rw-p 00000000 00:00 0
761a9000-761b0000 r-xp 00000000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761b0000-761bf000 ---p 00007000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761bf000-761c0000 r--p 00006000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761c0000-761c1000 rw-p 00007000 b3:07 306343 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
761d4000-761f7000 r-xp 00000000 b3:07 301246 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libjava.so
761f7000-761ff000 ---p 00023000 b3:07 301246 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libjava.so
761ff000-76200000 rw-p 00023000 b3:07 301246 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libjava.so
76200000-76221000 rw-p 00000000 00:00 0
76221000-76300000 ---p 00000000 00:00 0
76303000-76309000 r-xp 00000000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
76309000-76318000 ---p 00006000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
76318000-76319000 r--p 00005000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
76319000-7631a000 rw-p 00006000 b3:07 306360 /lib/arm-linux-gnueabihf/librt-2.19.so
7631a000-7631d000 ---p 00000000 00:00 0
7631d000-7636a000 rwxp 00000000 00:00 0
7636a000-763d3000 r-xp 00000000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763d3000-763e3000 ---p 00069000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763e3000-763e4000 r--p 00069000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763e4000-763e5000 rw-p 0006a000 b3:07 306222 /lib/arm-linux-gnueabihf/libm-2.19.so
763e5000-76968000 r-xp 00000000 b3:07 301286 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/client/libjvm.so
76968000-76970000 ---p 00583000 b3:07 301286 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/client/libjvm.so
76970000-7699c000 rw-p 00583000 b3:07 301286 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/client/libjvm.so
7699c000-76dbf000 rw-p 00000000 00:00 0
76dbf000-76ddc000 r-xp 00000000 b3:07 306364 /lib/arm-linux-gnueabihf/libgcc_s.so.1
76ddc000-76deb000 ---p 0001d000 b3:07 306364 /lib/arm-linux-gnueabihf/libgcc_s.so.1
76deb000-76dec000 rw-p 0001c000 b3:07 306364 /lib/arm-linux-gnueabihf/libgcc_s.so.1
76dec000-76f17000 r-xp 00000000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f17000-76f27000 ---p 0012b000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f27000-76f29000 r--p 0012b000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f29000-76f2a000 rw-p 0012d000 b3:07 306260 /lib/arm-linux-gnueabihf/libc-2.19.so
76f2a000-76f2d000 rw-p 00000000 00:00 0
76f2d000-76f2f000 r-xp 00000000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f2f000-76f3e000 ---p 00002000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f3e000-76f3f000 r--p 00001000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f3f000-76f40000 rw-p 00002000 b3:07 306352 /lib/arm-linux-gnueabihf/libdl-2.19.so
76f40000-76f54000 r-xp 00000000 b3:07 301431 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/arm/jli/libjli.so
76f54000-76f5c000 ---p 00014000 b3:07 301431 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/arm/jli/libjli.so
76f5c000-76f5d000 rw-p 00014000 b3:07 301431 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/arm/jli/libjli.so
76f5d000-76f71000 r-xp 00000000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f71000-76f81000 ---p 00014000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f81000-76f82000 r--p 00014000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f82000-76f83000 rw-p 00015000 b3:07 306307 /lib/arm-linux-gnueabihf/libpthread-2.19.so
76f83000-76f85000 rw-p 00000000 00:00 0
76f86000-76f8f000 r-xp 00000000 b3:07 301271 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libverify.so
76f8f000-76f97000 ---p 00009000 b3:07 301271 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libverify.so
76f97000-76f98000 rw-p 00009000 b3:07 301271 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/libverify.so
76f98000-76f9d000 r-xp 00000000 b3:07 18866 /usr/lib/arm-linux-gnueabihf/libarmmem.so
76f9d000-76fac000 ---p 00005000 b3:07 18866 /usr/lib/arm-linux-gnueabihf/libarmmem.so
76fac000-76fad000 rw-p 00004000 b3:07 18866 /usr/lib/arm-linux-gnueabihf/libarmmem.so
76fad000-76fcd000 r-xp 00000000 b3:07 306243 /lib/arm-linux-gnueabihf/ld-2.19.so
76fce000-76fd6000 rw-s 00000000 b3:07 25448 /tmp/hsperfdata_pi/3278
76fd6000-76fd7000 r--p 00000000 00:00 0
76fd7000-76fda000 rw-p 00000000 00:00 0
76fda000-76fdc000 rw-p 00000000 00:00 0
76fdc000-76fdd000 r--p 0001f000 b3:07 306243 /lib/arm-linux-gnueabihf/ld-2.19.so
76fdd000-76fde000 rw-p 00020000 b3:07 306243 /lib/arm-linux-gnueabihf/ld-2.19.so
7eadb000-7eafb000 rwxp 00000000 00:00 0 [stack]
7eafb000-7eafc000 rw-p 00000000 00:00 0
7ec39000-7ec3a000 r-xp 00000000 00:00 0 [sigpage]
7ec3a000-7ec3b000 r--p 00000000 00:00 0 [vvar]
7ec3b000-7ec3c000 r-xp 00000000 00:00 0 [vdso]
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]

VM Arguments:
jvm_args: -Dapplication.home=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt -Xms8m -Xmx1024m -Xms256m
java_command: com.sun.tools.javac.Main @/tmp/org.codehaus.plexus.compiler.javac.JavacCompiler6977397842974037963arguments
java_class_path (initial): /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/lib/tools.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/classes
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/home/pi/apache-maven-3.5.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
SHELL=/bin/bash
DISPLAY=:0.0

Signal Handlers:
SIGSEGV: [libjvm.so+0x506638], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0x506638], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0x3fd4ec], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR2: [libjvm.so+0x3fd650], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none


--------------- S Y S T E M ---------------

OS:PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

uname:Linux 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l
libc:glibc 2.19 NPTL 2.19
rlimit: STACK 8192k, CORE 0k, NPROC 7336, NOFILE 65536, AS infinity
load average:2.59 1.36 0.67

/proc/meminfo:
MemTotal: 947732 kB
MemFree: 33420 kB
MemAvailable: 141108 kB
Buffers: 1804 kB
Cached: 373096 kB
SwapCached: 4964 kB
Active: 459912 kB
Inactive: 400892 kB
Active(anon): 362072 kB
Inactive(anon): 357640 kB
Active(file): 97840 kB
Inactive(file): 43252 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 102396 kB
SwapFree: 0 kB
Dirty: 420 kB
Writeback: 0 kB
AnonPages: 482192 kB
Mapped: 330956 kB
Shmem: 233756 kB
Slab: 27652 kB
SReclaimable: 15108 kB
SUnreclaim: 12544 kB
KernelStack: 2744 kB
PageTables: 10800 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 576260 kB
Committed_AS: 2995964 kB
VmallocTotal: 1114112 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
CmaTotal: 8192 kB
CmaFree: 3720 kB


CPU:total 4 (ARMv7), vfp

/proc/cpuinfo:
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : BCM2709
Revision : a22082
Serial : 0000000083582adf


Memory: 4k page, physical 947732k(33420k free), swap 102396k(0k free)

vm_info: Java HotSpot(TM) Client VM (25.65-b01) for linux-arm-vfp-hflt JRE (1.8.0_65-b17), built on Oct 6 2015 16:19:04 by "java_re" with gcc 4.7.2 20120910 (prerelease)

time: Wed Apr 26 16:38:17 2017
elapsed time: 0 seconds (0d 0h 0m 0s)




I would like to let you know that Java, by default, does not uses all available memory. You need to run the application with the corresponding parameters.

Also, note that there are lot of JVM arguments that affect the JVM's memory usage like -Xms, -Xmx, -Xns, -XX:MaxPermSize

To know details about arguments read below points

-Xms: this option sets the initial and minimum Java heap size.

-Xmx: This option sets the maximum Java heap size. The Java heap (the “heap”) is the part of the memory where blocks of memory are allocated to objects and freed during garbage collection.

-XX:PermSize: -XX:MaxPermSize: are used to set size for Permanent Generation. The permanent space is where are stored the class, methods, internalized strings, and similar objects used by the VM and never deallocated (hence the name).

-Xss: sets the thread stack size. Thread stacks are memory areas allocated for each Java thread for their internal use. This is where the thread stores its local execution state.

-Xns: sets the nursery size. the JRockit JVM uses a nursery when the generational garbage collection model is used, that is, when the dynamic garbage collector has determined that the generational garbage collection model should be used or when the static generational concurrent garbage collector ( -Xgc : gencon) has been selected. You can also use -Xns to set a static nursery size when running a dynamic garbage collector (-XgcPrio).

If you are getting java.lang.OutOfMemoryError: Java heap space than change the value of -Xmx and -Xms.
if you are getting java.lang.OutOfMemoryError: PermGen space than try increasing the - XX:MaxPermSize value.
if you are getting java.lang.StackOverflowError than try increasing the -Xss value. It may be helpful by increasing the stack size but you should have a look at your code as well.
Posts: 1
Joined: Mon May 08, 2017 11:00 am
by clicky » Tue May 09, 2017 7:26 am
If you are really interested I have found nice not so in depth explanation here: http://stackoverflow.com/questions/3496442/java-why-does-it-uses-a-fixed-amount-of-memory-or-how-does-it-manage-the-memor
Mind you, java is over 20 years old and memory management was really stable for most of those 20+ years and cause for it gaining popularity. Other techniques in use then made so many buggy, memory leaking programs where Java's GC fixed it and made developers' life much easier.

BTW there were some changes in memory model recently: http://karunsubramanian.com/websphere/one-important-change-in-memory-management-in-java-8/

Still - all of it doesn't prevent you allocating 'all' memory at the startup (telling Java that it is 'allowed' to take more memory than originally defined). It won't immediately allocate all but over time it will favor getting more memory vs freeing some allocated...
Posts: 200
Joined: Thu Oct 25, 2012 7:34 am