[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - JBMESSAGING-1678 - OME on Journal Load

clebert.suconic@jboss.com do-not-reply at jboss.com
Tue Jul 7 18:32:50 EDT 2009


As stated on the jira (https://jira.jboss.org/jira/browse/JBMESSAGING-1678), when you have too many files on the journal, the load will fail with OME.

I didn't find a way to use a Map, as we need the order of Adds and updates preserved.


An easy solution so far, was to cleanup the lists every time the list is too big. 

Any time the list gets too big (to an arbitrary constant number of elements) I simply cleanup the list.


Changes:

   public synchronized long load(final List<RecordInfo> committedRecords,
  |                                  final List<PreparedTransactionInfo> preparedTransactions) throws Exception
  |    {
  | ...
  | 
  |       final int DELETE_FLUSH = 20000;
  | 
  | ...
  |          public void deleteRecord(final long id)
  |          {
  |             recordsToDelete.add(id);
  |             
  |             if (recordsToDelete.size() == DELETE_FLUSH)
  |             {
  |                Iterator<RecordInfo> iter = records.iterator();
  |                while (iter.hasNext())
  |                {
  |                   RecordInfo record = iter.next();
  |                   
  |                   if (recordsToDelete.contains(record.id))
  |                   {
  |                      iter.remove();
  |                   }
  |                }
  | 
  |                recordsToDelete.clear();
  |                System.out.println("after cleanup " + records.size());
  |                
  |             }
  |          }
  |       });
  | 



I don't want to add another configuration property for this. (I would just keep the constant instead of bothering the user with another descision at runtime).


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242306#4242306

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242306



More information about the jboss-dev-forums mailing list