error='Cannot allocate memory' (errno=12)

0

Hello people!

Unfortnaly I have a problem with my JasperServer, but maybe you could be the one to help me out!

Every month there is one process that generates around 400 documents.

Last night this process again run and the JasperServer got a error:

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000d61b0000, 485883904, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 485883904 bytes for committing reserved memory.


The JasperServer 7 is running on a Ubuntu 19.04 Vultr machine with 2048 MB of RAM.

Based on the JasperServer specs I would asume it's better to increase the amount of RAM and probably the allocate memory error will then also be fixed.

But I want to try to get this problem fixed without adding more ram to the server.

Would anyone have some tips for me on how to doing that?

Kind regards,

nick_39's picture
Joined: Jun 4 2019 - 10:15pm
Last seen: 32 sec ago

What version are you running? 

But I doubt you'll get a better answer than to add memory.

djohnson53 - 4 weeks 1 day ago

We have jasper 7 running, is there not a way to limit the amount of memory that Java can use so this error wil not happen anymore?

nick_39 - 4 weeks 23 hours ago

That's what you're doing now - limiting the memory available. That's why you're getting the error.

djohnson53 - 4 weeks 15 hours ago
show 1 more...

Is there a way to fix this so we can stay on this amount of memory? Increasing it makes it more expensive and for only a few reports that does not make a lot of sense.

nick_39 - 4 weeks 3 hours ago

3 Answers:

0

Looks like that one job to run 400 documents needs 485MB free to run.   I see you run 2048MB, but how much is free?

Is that  Ubuntu Vlutr running core minimalist without a GUI?

If not you could try disabling services but 2GB is pretty tight.    That's pretty out of the scope of this forum.

If you really wanted to pinch pennies, just split your report up.  Instead of one huge document run split it up into a number of smaller automated document runs.

(Change the criteria of your report by some factor to make it into something smaller to manage.)

danoldenkamp@gmail.com's picture
Joined: Aug 29 2018 - 11:12am
Last seen: 12 hours 3 min ago
1

There is also a Virtualizer for running large reports. We used this for generating large stock or calculation based reports within our ERP-System some years ago where some Reports runs took even several hours and not to run into the OutOfMemory we used the (GZip)Virturalizer logic - Worked fine when I remember right. ;-)

http://jasperreports.sourceforge.net/sample.reference/virtualizer/index.html

hth + regards

C-Box

C-Box's picture
2172
Joined: Jul 19 2006 - 5:58pm
Last seen: 3 days 21 hours ago
0

Our system does 400 calls to the jasperserver to generate the reports so in this case I asume 400 jobs. We now tried to limit the java memory by 

export JAVA_OPTS="-Xms1536m -Xmx1536m -XX:PermSize=32m"

But I'm not sure if this will work?

nick_39's picture
Joined: Jun 4 2019 - 10:15pm
Last seen: 32 sec ago
Feedback
randomness