title: ActiveMq, unconsumed messages are always in broker's memory?
body: <p>I am using <strong>ActiveMQ</strong> and have a question about how and when the persisted messages do really get swapped to disk, while waiting for consumer?</p>
  
  <p>I am using <em>virtual topics</em>, and create queue consumers to receive messages from them. All messages are <strong>persisted</strong> (I've verified that records for all non consumed messages do present in the persistence storage)</p>
  
  <p>I have a multiple consumers which regularly come on and off line. Having connected <strong>jconsole</strong> to activemq I noticed that <strong>ALL not consumed messages</strong> seem to be contained in broker's memory. They do not get swapped to disk, at least I was not able to verify that.
  Setting the <code>memoryUsage</code> or turning <code>producerFlowControl</code> on - does not have any effect. Broker is whether blocked if memoryUsage limit is hit with flow control on, or MemoryPercentUsage keeps increasing if flow control is off.</p>
  
  <p>When exactly activemq frees memory by storing the messages to disk/persistence storage? Or does it so? How can I verify it is disk space not RAM which will limit the broker in a long run when there are millions of not consumed (pending) messages in queues?</p>