directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Re: Replication tests : memory leak
Date Wed, 10 Aug 2011 04:46:11 GMT
On 8/9/11 9:57 PM, Kiran Ayyagari wrote:
> On Tue, Aug 9, 2011 at 10:58 PM, Emmanuel Lecharny<>  wrote:
>> Hi,
>> I tried to launch a test with 10000 modifications (modDn test) to see what
>> could happen, but the test fails after a few thousands loops (around 4000).
>> I started a profiling session, and I saw that the memory is quickly consumed
>> and never released.
>> I tested with 128M, 256M and 512M, the only difference is the number of
>> loops we can do.
>> When we reach the memory limit, the GC start to kick hard and so does the
>> CPU. I have beautiful curves on VisualVM !
>> We do have a memory leak somewhere, we now have to find where ! IMO, it
>> seems that the ActiveMQ queues are storing refs in memory, and aren't
>> cleaned when we pick a message. To be checked.
> I think this is quite likely the scenario cause we use in-vm transport
> for communicating with queues

I tried to configure ActiveMQ to use what they call File Based Cursor, 
with no success 

Here is the code I added :

             // Create the system responsible for transmitting the 
requests when
             // the direct connection to the consumer is closed.
             brokerService = new BrokerService();
             brokerService.setUseJmx( false );
             brokerService.setPersistent( true );
             brokerService.setDataDirectory( path );

             PolicyMap policyMap = new PolicyMap();

             // The Topic policyEntry
             PolicyEntry topicPolicyEntry = new PolicyEntry();
             topicPolicyEntry.setTopic( ">" );
             topicPolicyEntry.setProducerFlowControl( true );

             // Limit memory used to 1M
             topicPolicyEntry.setMemoryLimit( 1000000L );

pendingSubscriberPolicy = new FilePendingSubscriberMessageStoragePolicy();
pendingSubscriberPolicy );

             policyMap.put( topicPolicyEntry.getDestination(), 
topicPolicyEntry );

             // The Queue policyEntry
             PolicyEntry queuePolicyEntry = new PolicyEntry();
             queuePolicyEntry.setTopic( ">" );
             queuePolicyEntry.setProducerFlowControl( true );

             // Limit memory used to 1M
             queuePolicyEntry.setMemoryLimit( 1000000L );

             PendingQueueMessageStoragePolicy pendingQueuePolicy = new 
             queuePolicyEntry.setPendingQueuePolicy( pendingQueuePolicy );

             policyMap.put( queuePolicyEntry.getDestination(), 
queuePolicyEntry );

             brokerService.setDestinationPolicy( policyMap );

Didn't changed anything. My understanding of ActiveMQ configuration is 
*very* limited, so it needs some more love from someone who knows how 
this configuration works.

Emmanuel L├ęcharny

View raw message