cf-mendix-buildpack icon indicating copy to clipboard operation
cf-mendix-buildpack copied to clipboard

No documentation of crucial setting MEMORY_LIMIT

Open macrel opened this issue 3 years ago • 0 comments

I was running into issues while tuning XMS and XMS javaopts (Heap Size) because it was being reset to a low number (256MB I beleive).

Long story short: please update the documentation to explain the MEMORY_LIMIT environment variable setting as this is hugely importand for any serious project that wants to modify heap_size.

More info: For our environment 256M heap size is way too low. So I setup a VM with 6GB memory and the container was allocated all memory. I wanted to set my heap_size to 4GB.

After starting up the docker container there was an error logged "The specified heap size XXX is larger than the maximum memory of the container (1024M)". Since I am running a docker container I obviously thought there must be something with the allocated memory for my docker container (as I knew of the memory parameter 'docker run --memory...') however that was not the case as docker stats showed me there was 10GB memory allocated.

It took me quite some time and headache to figure out that this 1024M is not a limit on my container at all, but a default limit in the CF buildpack..! I refer to the file java.py , line 291. Then reading the code in this file I see something about an environment variable "MEMORY_LIMIT" to override this default. So I added this env. variable and my problems were fixed.

Please add this to the documentation as I think it's crucial information.

macrel avatar Oct 14 '22 12:10 macrel