unable to allocate memory error on mac os x - java

2019-08-29 08:11发布

问题:

I believe it's a general issue but if it helps I'm running LucidDB database (0.9.4) on Mac OS X 10.8 with 16GB RAM. The database software is written mainly in Java with some parts in C++. When I increased buffer pool size to 1GB I got the following error.

java(669,0xfc621000) malloc: * mmap(size=16777216) failed (error code=12) error: can't allocate region ** set a breakpoint in malloc_error_break to debug

I believe that buffer pool uses shared memory so I increased max available shared memory (kern.sysv.shmmax, kern.sysv.shmall) to 2GB. I also increased java heap size (Xms, Xmx) to 1536MB. I'm stuck, any hints?

回答1:

Whenever I have seen these strange low level error under linux I have traced it to a lack of resource of some kind such as running out of swap or remapping virtual memory too often. There should be a utility which gives you a dump of all the memory mappings in the running program. I would check whether the number of mappings is too high.