Using RabbitMQ and Spring AMQP I have a Java application containing some @RabbitListener
s. These consumers listen to a queue and process messages very quickly. I am interested to know the memory behaviour of this application over time (I will supply a load test via some tool such as JMeter).
My question is regarding the approach. First of all, I'm not an expert in the Java memory model. In my understanding, I have to refer to the used Java heap memory to see how much memory that processing messages consumes in my application over time. Is this correct? Are there other relevant metrics?
Secondly, because of the Java garbage collector, there will be some delay before the garbage collector kicks in and does its job, freeing memory and updating the used memory heap. If I run a short test, such as a test lasting less than a minute, what guarantees do I have that the garbage collector will kick in frequently enough that I can see a result of varying memory size (I do not want to see constant memory over time)?