tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier (tomcat)>
Subject Re: Cannot Allocate Memory errno=12
Date Wed, 18 Jan 2017 14:10:18 GMT
On 18.01.2017 14:51, André Warnier (tomcat) wrote:
> Actually, I think that you need to look closer at the tomcat shutdown scripts on your
> system, and their settings.
> If I remember correctly, when you call the tomcat shutdown script, it actually starts
> another java JVM instance, just to send a shutdown message to the running tomcat's JVM.
> And with your current JAVA_OPTS, it looks like this shutdown JVM is also requesting a
> heap with an initial size of 8 GB.  And that is what may trigger this OOM.
> There is something in that area about the difference between JAVA_OPTS and CATALINA_OPTS.

Additional information :
(I have now found it again)

Somewhere in your tomcat software directory (which may be anywhere, depending on where you

got this tomcat from), there is a file named "RUNNING.txt".
In this file is a section which I copy below here, in case you are having trouble finding

it.  It explains what happens with these JAVA_OPTS and CATALINA_OPTS environment 
variables. In particular the last paragraph.


(3.3) Other variables (optional)

Other environment variables exist, besides the four described above.
See the comments at the top of catalina.bat or scripts for
the list and a description of each of them.

One frequently used variable is CATALINA_OPTS. It allows specification of
additional options for the java command that starts Tomcat.

See the Java documentation for the options that affect the Java Runtime

See the "System Properties" page in the Tomcat Configuration Reference for
the system properties that are specific to Tomcat.

A similar variable is JAVA_OPTS. It is used less frequently. It allows
specification of options that are used both to start and to stop Tomcat as well
as for other commands.

Note: Do not use JAVA_OPTS to specify memory limits. You do not need much
memory for a small process that is used to stop Tomcat. Those settings
belong to CATALINA_OPTS.


> On 18.01.2017 14:31, André Warnier (tomcat) wrote:
>> On 18.01.2017 14:20, Fady Haikal wrote:
>>> plz find it on the below link
>> Hmm, that's a nice logfile.
>> It also starts with a number of hints and recommendations, did you see ?
>> Very generically :
>> When tomcat is shutting down, it does need some extra memory for a while, to run
>> shutdown processes (in addition to the other processes which are running).
>> So it asks the Java JVM for more memory.
>> And then the java JVM asks the OS for that extra memory.
>> And in your case, it does not get it, because the OS is telling it that there is
no more
>> available memory. So the JVM crashes.
>> Now why there is no more memory available at that time, is mostly for you to find
>> There are certainly other processes running on that server, in addition to tomcat's
>> JVM. They use memory too.
>> And otherwise, either you need a bigger system, or you need smaller applications.
>>> On Wed, Jan 18, 2017 at 3:16 PM, André Warnier (tomcat) <>
>>>> On 18.01.2017 14:08, Fady Haikal wrote:
>>>>> Yes log already sent, anw attached
>>>> Well no. Only the "" was attached.
>>>> This list server strips many attachments. Maybe you need to paste the
>>>> content directly into your message (if not too long), or post it somewhere
>>>> where we can look at it.
>>>>> On Wed, Jan 18, 2017 at 3:07 PM, André Warnier (tomcat) <>
>>>>> wrote:
>>>>>> On 18.01.2017 13:49, Fady Haikal wrote:
>>>>>>> Guys, We are facing the below error (attached also) while trying
>>>>>>> shutdown tomcat server
>>>>>>> Java HotSpot(TM) 64-Bit Server VM warning: INFO:
>>>>>>> os::commit_memory(0x00000000d5550000, 715849728, 0) failed;
>>>>>>> error='Cannot allocate memory' (errno=12)
>>>>>>> #
>>>>>>> # There is insufficient memory for the Java Runtime Environment
>>>>>>> continue.
>>>>>>> # Native memory allocation (mmap) failed to map 715849728 bytes
>>>>>>> committing reserved memory.
>>>>>>> # An error report file with more information is saved as:
>>>>>>> # /home/Jakob/Apps/Botlanegg/hs_err_pid40075.log
>>>>>>> Server Memory is 14 GB
>>>>>>> Tomcat allocate 10 GB
>>>>>>> Attached
>>>>>>> Please advise
>>>>>>> Regards,
>>>>>>> Fady
>>>>>> And does the above-mentioned error report file contain more information,
>>>>>> as
>>>>>> it seems to promise ?
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail:
>>>>>> For additional commands, e-mail:
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
>>>>> For additional commands, e-mail:
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>>>> For additional commands, e-mail:
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> For additional commands, e-mail:
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message