Make Limits Java Heap Size on 32-bit Linux
Jul 23rd, 2015

aaaaargh! frustrating java make project management random
Annual hours saved: 2

Here’s a fun one. The following command:

java -Xmx2g Test

works fine when run from the command-line, but not when run from within a make recipe. It errors out with the following message:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

After a substantial amount of web searching, I still don’t have a good answer as to why this is, but it seems only to be an issue on 32-bit versions of Linux, as mentioned here: https://community.oracle.com/thread/1543487. My guess is that make somehow limits the amount of memory it and its sub-processes can allocate, but I haven’t been able to confirm this. If I get any answers, I’ll post an update.

Your E-Sheep:

( change )

Recent Posts:

10/14 - ADHOC Changelog
8/19 - And now… random puppies!
8/3 - Check Braces
7/23 - Make Limits Java Heap Size on 32-bit Linux
7/21 - Terminal Color Support in Makefiles

Search
Top Tags:

aaaaargh! algorithms automatic awesome colors config development environment documentation frustrating java linux make parsing project management random syntax-highlighting terminal types

Random Quote:

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
anonymous (variant of original by Phil Karlton)

Powered By:
License:

2017 - Creative Commons 3.0