ORA-29554 unhandled java out of memory condition

I have had issues with this error message before.  You can find my first go-round with this thing here:

http://www.experts-exchange.com/Databases/Oracle/Q_20457732.html

i am getting the ORA-29554 error while trying to parse xml files when i attempt to run too many records through my process at one time. i have upped my JAVA_MAX_SESSIONSPACE_SIZE to 200mb in my INIT.ORA file. it's hard to believe that i'm using all of this up? does anyone know if it's common to have this param set higher than this? also, can someone look over my procedure below and tell me if you see a component that i'm not freeing or something? i'm trying figure out what is hogging up all my memory. while this procedure is called many times within the same process (using a loop for each xml file i have), after i'm done with it each time i can totally free all the memory. i don't need anything else from it. am i doing that correctly with the statements at the end of the proc? any comments/suggestions will be greatly appreciated. feel free to ask any questions that can help clear things up.

thanks,

ben

CREATE OR REPLACE PROCEDURE boxml_proc (
   p_xml_dir   VARCHAR2,
   p_xsl_dir   VARCHAR2,
   p_xmlfile   VARCHAR2,
   p_xslfile   VARCHAR2,
   p_resfile   VARCHAR2
)
IS
   v_p             sys.xmlparser.parser;
   v_xmldoc        sys.xmldom.domdocument;
   v_xmldocnode    sys.xmldom.domnode;
   v_proc          sys.xslprocessor.processor;
   v_ss            sys.xslprocessor.stylesheet;
   v_xsldoc        sys.xmldom.domdocument;
   v_docfrag       sys.xmldom.domdocumentfragment;
   v_docfragnode   sys.xmldom.domnode;
   v_xslelem       sys.xmldom.domelement;
   c_nspace        VARCHAR2 (50);
   v_xslcmds       sys.xmldom.domnodelist;
BEGIN

--new parser
   v_p := sys.xmlparser.newparser;

--set characteristics
   sys.xmlparser.setvalidationmode (v_p, FALSE);
   sys.xmlparser.setpreservewhitespace (v_p, TRUE);
   sys.xmlparser.setbasedir (v_p, p_xml_dir);

-- parse xml file
   sys.xmlparser.parse (v_p,    p_xml_dir
                             || '/'
                             || p_xmlfile);

--get document
   v_xmldoc := sys.xmlparser.getdocument (v_p);

--parse xsl file
   sys.xmlparser.parse (v_p,    p_xsl_dir
                             || '/'
                             || p_xslfile);

--get document
   v_xsldoc := sys.xmlparser.getdocument (v_p);
   v_xslelem := sys.xmldom.getdocumentelement (v_xsldoc);
   c_nspace := sys.xmldom.getnamespace (v_xslelem);
   v_xslcmds := sys.xmldom.getchildrenbytagname (v_xslelem, '*', c_nspace);

--make stylesheet
   v_ss := sys.xslprocessor.newstylesheet (
              v_xsldoc,
                 p_xsl_dir
              || '/'
              || p_xslfile
           );

--process xsl
   v_proc := sys.xslprocessor.newprocessor;
   sys.xslprocessor.showwarnings (v_proc, TRUE);
   v_docfrag := sys.xslprocessor.processxsl (v_proc, v_ss, v_xmldoc);
   v_docfragnode := sys.xmldom.makenode (v_docfrag);
      sys.xmldom.writetofile (v_docfragnode,    p_xml_dir
                                          || '/'
                                          || p_resfile);
 sys.xmlparser.freeparser(v_p);
 sys.xmldom.freedocument(v_xmldoc);
 sys.xmldom.freedocument(v_xsldoc);
 sys.xslprocessor.freeprocessor(v_proc);
 sys.xslprocessor.freestylesheet(v_ss);

 END;
/
LVL 1
benpungAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
indypungConnect With a Mentor Commented:
i am closing this due to extended inactivity.  i realized that i'm using the DOM API to do the xml parsing and this is very memory intensive so i need to look in to using SAX.
0
 
Daniel StanleyDatabase engineerCommented:
i'd query the sga usage(v$sgastat) and verify which component gets utilized fully when running the xml code; then increase the parameter accordingly.


good luck,
daniels@asix.com
0
 
benpungAuthor Commented:
i have not forgotten about this issue. i've just been sidetracked with some other stuff. i'll try the suggestion when i get time and let you know. thanks for the help.
0
 
benpungAuthor Commented:
how do i tell which component gets utilized?
0
All Courses

From novice to tech pro — start learning today.