0

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!

trincot
  • 317,000
  • 35
  • 244
  • 286
Ayeyebraso
  • 11
  • 1
  • 4

1 Answers1

0

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.

Ayeyebraso
  • 11
  • 1
  • 4