You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Alan Protasio (JIRA)" <ji...@apache.org> on 2019/05/08 19:00:00 UTC

[jira] [Created] (AMQ-7196) During startup ActiveMq load all the scheduleDB.data on memory causing OOM

Alan Protasio created AMQ-7196:
----------------------------------

             Summary: During startup ActiveMq load all the scheduleDB.data on memory causing OOM 
                 Key: AMQ-7196
                 URL: https://issues.apache.org/jira/browse/AMQ-7196
             Project: ActiveMQ
          Issue Type: Bug
          Components: KahaDB
    Affects Versions: 5.15.9, 5.16.0
            Reporter: Alan Protasio


I had a broker with lots of scheduled messages and I noticed that during startup (clean or unclean) the broker was reading the whole index file and storing it os memory:

[https://github.com/apache/activemq/blob/master/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java#L665]

In order to prevent the OOM, I changed this method to return a Iterator<JobLocation> instead of a List<JobLocation> avoiding load all this data into the heap.

 

I also noticed that during the startup we read the index at least 3 times:

 

[https://github.com/apache/activemq/blob/master/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java#L829]

[https://github.com/apache/activemq/blob/master/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java#L857]

and 

[https://github.com/apache/activemq/blob/master/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java#L940]

 

Probably we can optimize this but this should be another Jira (also maybe we dont need to call recover(tx) when its a clean shutdown)

[https://github.com/apache/activemq/blob/master/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java#L787]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)