Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#495 closed defect (invalid)

Metadata services cause out of memory issue

Reported by: rupert Owned by: geonetwork-devel@…
Priority: major Milestone: v2.6.5
Component: General Version: v2.6.3
Keywords: xml services, heap memory Cc:

Description

The metadata services metadata.insert and metadata.update never release the memory they use, so after repeated use Geonetwork runs out of heap space.

I am trying to automate the population of GeoNetwork and the services work fine until the heap space is used up. If I increase the heap, more records can be processed but the memory is never released and it will eventually hang GeoNetwork.

Services used, metadata.insert, metadata.update, xml.search

Could some check to see if the code just forgot to deallocate the memory used in this service.

Thanks.

Change History (3)

comment:1 by simonp, 14 years ago

Resolution: invalid
Status: newclosed

Actually metadata.insert and metadata.update all forward to metadata.edit - metadata.edit will store the metadata record in the session and release it when the user saves the record - this is the intended behaviour as they are used by the user interface.

Shouldn't you be using xml.metadata.insert (this is basically the same as metadata.insert without a forward to metadata.edit) for external automation?

If you need an xml.metadata.update service then perhaps you could put in an enhancement request. In the meantime, you could easily create such a service for yourself to avoid this issue (eg. by following the same example as metadata.insert and xml.metadata.insert) and that way continue with your automation project.

comment:2 by simonp, 14 years ago

Alternatively, if you are somehow using the response from the forward to metadata.edit by metadata.insert and then using that in the call metadata.update then you should call metadata.update.finish instead, it does what metadata.update does but it also removes the metadata from the session and does not forward to metadata.edit (this is what happens when you do a 'Save and Close' in the editor).

in reply to:  2 comment:3 by rupert, 14 years ago

Replying to simonp:

Alternatively, if you are somehow using the response from the forward to metadata.edit by metadata.insert and then using that in the call metadata.update then you should call metadata.update.finish instead, it does what metadata.update does but it also removes the metadata from the session and does not forward to metadata.edit (this is what happens when you do a 'Save and Close' in the editor).

The call to metadata.update.finish is exactly what I needed. This is undocumented, are there other gems that would be useful to others? Thanks for the help.

Note: See TracTickets for help on using tickets.