I'm trying to send a BytesMessage on AMQ (5.15.2) but I run in a heap space exception even if the memory is clearly available. Here is the
byte[] contcentBuilder = new Byte[1000*1000*1];
Array.fill(contentBuilder, (byte) 1);
BytesMessage message = session.createBytesMessage();
for(int i=0;i<150;i++){
message.writeBytes(contentBuilder);
}
contentBuilder=null;
producer.send(message); //here it gets the heap space memory error
Runtime.getRunTime().freeMemory(); //this is in debug
In the bug the memory available is over 15Gb (I allocated 16Gb to this VM).
Any ideas are welcome, thank you.
EDIT: I'm basically dumb, the problem was on the AMQ side of things and increasing it's memory in the bin/win64/wrapper.conf did the job. thanks to all who answered.
New here I don't know how to close this answer!
Still me, the problem was on the AMQ side of things and increasing it's memory in the bin/win64/wrapper.conf did the job. thanks to all who answered.