You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2019/09/06 15:54:00 UTC

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

    [ https://issues.apache.org/jira/browse/AMQ-7196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924355#comment-16924355 ] 

ASF subversion and git services commented on AMQ-7196:
------------------------------------------------------

Commit dc35218a2d766a86a78376bfd4b51e7ae5bda935 in activemq's branch refs/heads/master from gtully
[ https://gitbox.apache.org/repos/asf?p=activemq.git;h=dc35218 ]

AMQ-7196 - fix broken test; recovery not applicable to inmemory store


> 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: 0.5h
>  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
(v8.3.2#803003)