I have a few for-each loops, that I use to iterate over the elements of a configuration XML which is very small size (2 KB on disk) to arrive at a source URL and a target URL dynamically. Then, I retrieve data from source URL using URLGenerator
(because it performs streaming) and load it to XML database using XForms Submissions processor. Source URL and Target URLs are computed dynamically and the innermost loops where the retrieval and loads take place happen about 32 times in total, each time with an XML file of about 4.5 MB on average (max. about 6 MB, min. a few KB). Every time I try this, I get out 开发者_StackOverflowof memory error for Tomcat running with permgen and heap sizes generously allocated, JVM is 32-bit, OS is 32-bit; I want a way out of this out-of-memory errors:
- I had thought the separate XForms Submissions will be separate transactions, so will not accumulate causing out-of-memory problem
- Is there a way to perform a streaming load using XForms Submissions processor instead of creating full document in memory?
- I do not know if that would help, but is there a way to perform aggressive garbage collection in Orbeon so I do not get out-of-memory problems?
If needed, I can post the code here (for the XPL).
Source code (in reply to the comment asking for it)
- If you run the
oxf:xforms-submission
inside a loop, they will run independently, and uploading 30 documents in the loop should only take the memory necessary for the largest document. - The XForms submission needs to have the full document in memory to be able to upload it; it doesn't support streaming (unlike the
oxf:url-generator
). - The default VM pergen setting is often too low, so I would recommend you to try to increase your permgen space.
精彩评论