[ 
https://issues.apache.org/jira/browse/AMQ-7196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christopher L. Shannon resolved AMQ-7196.
-----------------------------------------
       Resolution: Fixed
    Fix Version/s: 5.15.10
                   5.16.0

> 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.16.0, 5.15.9
>            Reporter: Alan Protasio
>            Assignee: Christopher L. Shannon
>            Priority: Major
>             Fix For: 5.16.0, 5.15.10
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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)

Reply via email to