[ome-devel] Ice::MemoryLimitException

josh.moore at gmx.de josh.moore at gmx.de
Tue Jan 20 19:54:02 GMT 2009


Bernhard Voigt writes:
 > Dear developers!

Hi Bernhard,

 > I'm trying to read project annotations from the annotation table. There are
 > many large text annotations to single projects, in total they could become a
 > few MB and I ran into Ice::MemoryLimitExceptions. I tried to only load the
 > link definition and loop through the list on the application level in order
 > to fetch single annotations. The code in Python is similar to this:
 > 
 >         query = '''
 >         select pal from ProjectAnnotationLink pal
 >         left  join pal.parent p
 >         where p.id = %i''' % projectId
 > 
 >         annotationLinks = queryService.findAllByQuery(query, None)
 > 
 >         for link in annotationLinks:
 >             query = '''
 >             select pal from ProjectAnnotationLink pal
 >             left join fetch pal.child a
 >             left outer join fetch a.details.creationEvent
 >             where pal.id = %i''' % link.id.val
 >             l = self.querys.findByQuery(query, None)
 >             yield l.child
 > 
 > However, I still get an Ice::MemoryLimitExcpetion during the execution of
 > the first query. Is this expected, how can I avoid this? Changing the
 > Ice.MessageSizeMax property to large values (several MB) didn't solve the
 > problem.

That findAllByQuery() throws a MemoryLimitException on just "select
pal from ProjectAnnotationLink" is pretty strange, and suggests a LOT
of links. I'd be interested in that number.

In general, though, the only thing a bit tricky with MessageSizeMax is
that it has to be set on all components in the statck: server, router,
and client -- otherwise each on of them can throw an exception. In
4.x, we've set the value to 64MB for each. In 3.x, the default is
4MB. Where did you change the value? You'll need to change all the
lines of the form:

<property name="Ice.MessageSizeMax" value="4096"/>

to 

<property name="Ice.MessageSizeMax" value="65536"/>

(or similar) as well as set the property in your client.

 > Thanks for help! Bernhard

Definitely. Let us know how that works for you.
~Josh.


More information about the ome-devel mailing list