3

Facing below error - While install and running one of my own application.

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x000000008a660000, 1973026816, 0) failed; error='Not enough space' (errno=12)

KiB Mem :  3852964 total,   358468 free,  3011660 used,   482836 buff/cache

KiB Swap:        0 total,        0 free,        0 used.   515060 avail Mem 

Space allocation are as below My system is consuming space as below details

Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           377M   42M  335M  12% /run
/dev/xvda1       97G   47G   51G  48% /
tmpfs           1.9G  188K  1.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/loop1       18M   18M     0 100% /snap/amazon-ssm-agent/1566
/dev/loop2       92M   92M     0 100% /snap/core/8689
/dev/loop0       90M   90M     0 100% /snap/core/8268
/dev/loop3       18M   18M     0 100% /snap/amazon-ssm-agent/1480
tmpfs           377M     0  377M   0% /run/user/1001
tmpfs           377M   32K  377M   1% /run/user/119
tmpfs           377M     0  377M   0% /run/user/1000

Any help ?

nanofarad
  • 40,330
  • 4
  • 86
  • 117
Saurabh Gupta
  • 133
  • 2
  • 8
  • 4
    358468 KiB is about 350 MiB. You cannot commit 1881 MiB with only 350 MiB of free space. Instead of posting *disk* usage (which is irrelevant because there's no swap) please post info about the processes using *RAM* (refer to https://www.networkworld.com/article/3516319/showing-memory-usage-in-linux-by-process-and-user.html for guidance); if a Java process is using excessive RAM please provide a heap snapshot. You may also need to pay for a larger server/allocation. **Edit - I see that this question is really old - why did it (specifically) get bountied?** – nanofarad Jun 01 '22 at 21:00

1 Answers1

1

Java HotSpot(TM) 64-Bit Server VM warning :

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (malloc) failed to allocate xxxxx 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=

If you are on Java 8 or later, please also see this question: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize

More information about issue and resolutions at:

Memory problem: 'error=12, Not enough space'

Forking JVM: error=12, Cannot allocate memory or error=12, Not enough space

ERROR: "Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000aaaa0000, 178978816, 0) failed; error=Cannot allocate memory"

Of course Java HotSpot VM Options would be useful too.

Eskandar Abedini
  • 2,090
  • 2
  • 13