<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic OutOfMemoryError: Java heap space in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315784#M86405</link>
    <description>Hello, 
&lt;BR /&gt;At the creation of an XML file (tAdvancedFileOutputXML), we had a problem: java.lang.OutOfMemoryError: Java heap space. 
&lt;BR /&gt;We solved by changing the parameter: generation mode "Fast memory-consuming goal - Dom4J" replaced by "Slow with no memory Consumed" 
&lt;BR /&gt;Can you explain how this generation mode work? 
&lt;BR /&gt;Is there a maximum size of the XML file? 
&lt;BR /&gt;Thanks and Regards.</description>
    <pubDate>Mon, 06 May 2013 10:30:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-05-06T10:30:10Z</dc:date>
    <item>
      <title>OutOfMemoryError: Java heap space</title>
      <link>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315784#M86405</link>
      <description>Hello, 
&lt;BR /&gt;At the creation of an XML file (tAdvancedFileOutputXML), we had a problem: java.lang.OutOfMemoryError: Java heap space. 
&lt;BR /&gt;We solved by changing the parameter: generation mode "Fast memory-consuming goal - Dom4J" replaced by "Slow with no memory Consumed" 
&lt;BR /&gt;Can you explain how this generation mode work? 
&lt;BR /&gt;Is there a maximum size of the XML file? 
&lt;BR /&gt;Thanks and Regards.</description>
      <pubDate>Mon, 06 May 2013 10:30:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315784#M86405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-06T10:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: OutOfMemoryError: Java heap space</title>
      <link>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315785#M86406</link>
      <description>Hi, 
&lt;BR /&gt;Here is a component reference 
&lt;A href="https://help.talend.com/search/all?query=tAdvancedFileOutputXML&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;tAdvancedFileOutputXML&lt;/A&gt;. 
&lt;BR /&gt;For the "OutOfMemoryErrorJava heap space issue", there are also workaround 
&lt;A href="https://community.qlik.com/s/article/ka03p0000006EZuAAM" target="_blank"&gt;outOfMemory&lt;/A&gt; and 
&lt;A href="https://help.talend.com/search/all?query=Allocating+more+memory+to+Talend+Studio&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;Allocating more memory to Talend Studio&lt;/A&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Sabrina</description>
      <pubDate>Mon, 06 May 2013 11:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315785#M86406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-06T11:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: OutOfMemoryError: Java heap space</title>
      <link>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315786#M86407</link>
      <description>Is there a maximum size of the XML file?&lt;BR /&gt;I'll have to deal with files becoming larger and I would anticipate a blocking&lt;BR /&gt;Best regards.</description>
      <pubDate>Mon, 06 May 2013 13:55:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315786#M86407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-06T13:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: OutOfMemoryError: Java heap space</title>
      <link>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315787#M86408</link>
      <description>Hi Noel, 
&lt;BR /&gt;in my experience, you will start having heap and memory problems like GC overhead limit exceeded with xml files larger than 700Mb even after hacking VM arguments and using SAX; 
&lt;BR /&gt;i had to deal with 1.2 up to 2Gb xml files as inputs, and the only way to do it was to split files into smaller one like 6Mb each and to a tfilelist to process them using the Dom4J parser. 
&lt;BR /&gt;user 
&lt;B&gt;brazabr&lt;/B&gt; helped me with this useful code that i added as a routine and used it in a tjava componement. 
&lt;BR /&gt; 
&lt;PRE&gt;    public static boolean split_file(String filename, int maxpart, String tagname, String roottag, String nsdeclaration){&lt;BR /&gt;        FileOutputStream fout = null;    &lt;BR /&gt;        PrintStream outstream = null;&lt;BR /&gt;        Scanner s = null;&lt;BR /&gt;        int part=0;&lt;BR /&gt;        int partsize=0;&lt;BR /&gt;        boolean partnew=true;&lt;BR /&gt;        String partfile, suffix, token;&lt;BR /&gt;        partfile = filename.replaceFirst("\\.xml$", "");&lt;BR /&gt;        try {&lt;BR /&gt;            s = new Scanner(new FileInputStream(filename),"utf-8");&lt;BR /&gt;            s.useDelimiter("&amp;lt;/" + tagname + "&amp;gt;");&lt;BR /&gt;            while (s.hasNext()) {&lt;BR /&gt;                if(partnew){ //begin a new part file&lt;BR /&gt;                    suffix = String.format("_part%04d.xml",part);&lt;BR /&gt;                    fout = new FileOutputStream (partfile + suffix);&lt;BR /&gt;                    outstream = new PrintStream(fout);&lt;BR /&gt;                    if (part&amp;gt;0){ //insert leading tags&lt;BR /&gt;                        outstream.println("&amp;lt;?xml version=\"1.0\" encoding=\"utf-8\"?&amp;gt;");&lt;BR /&gt;                        outstream.println("&amp;lt;" + roottag + " " + nsdeclaration + "&amp;gt;");&lt;BR /&gt;                    }&lt;BR /&gt;                    partsize=0;&lt;BR /&gt;                    partnew=false;&lt;BR /&gt;                }&lt;BR /&gt;                //just append tokens&lt;BR /&gt;                token = s.next();&lt;BR /&gt;                outstream.print(token);&lt;BR /&gt;                //if not last chunk append closing tag&lt;BR /&gt;                if (token.indexOf("&amp;lt;/" + roottag + "&amp;gt;")&amp;lt;0)     outstream.println("&amp;lt;/" + tagname + "&amp;gt;");&lt;BR /&gt;                partsize += token.length();&lt;BR /&gt;                if (partsize &amp;gt; maxpart) { //time to wrap it up&lt;BR /&gt;                    outstream.println("&amp;lt;/" + roottag + "&amp;gt;");&lt;BR /&gt;                    outstream.close();&lt;BR /&gt;                    outstream = null;&lt;BR /&gt;                    fout.close();&lt;BR /&gt;                    fout = null;&lt;BR /&gt;                    part++;&lt;BR /&gt;                    partnew = true;&lt;BR /&gt;                }&lt;BR /&gt;            }&lt;BR /&gt;            //dump the remaining part to out&lt;BR /&gt;            outstream.close();&lt;BR /&gt;            //fout.close();&lt;BR /&gt;            return true;&lt;BR /&gt;        } catch (Exception e) {&lt;BR /&gt;            System.out.println(e.getMessage());&lt;BR /&gt;            if (s != null) {&lt;BR /&gt;                s.close();&lt;BR /&gt;            }&lt;BR /&gt;            if (outstream != null) {&lt;BR /&gt;                outstream.close();&lt;BR /&gt;            }&lt;BR /&gt;            return false;&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 May 2013 16:25:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315787#M86408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-06T16:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: OutOfMemoryError: Java heap space</title>
      <link>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315788#M86409</link>
      <description>Hello, 
&lt;BR /&gt;I have seen lot of people having issue with handling Huge XML files. 
&lt;BR /&gt;I have written a small post for working with Large XML files in Talend. Please visit the link below for more details: 
&lt;BR /&gt; 
&lt;A href="http://www.vikramtakkar.com/2013/09/handling-huge-xml-files-in-talend.html" rel="nofollow noopener noreferrer"&gt;http://www.vikramtakkar.com/2013/09/handling-huge-xml-files-in-talend.html&lt;/A&gt; 
&lt;BR /&gt;Let me know, if it helps.</description>
      <pubDate>Tue, 03 Sep 2013 16:12:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315788#M86409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-03T16:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: OutOfMemoryError: Java heap space</title>
      <link>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315789#M86410</link>
      <description>hi all, 
&lt;BR /&gt;there is no determinated size to say that it will be out of heap (of number of java object). 
&lt;BR /&gt;I read a file about 5Go (with SAX) but only several elements. 
&lt;BR /&gt;So it could be empiric to know when a job crash due to too many java object. 
&lt;BR /&gt;BUT you have to optimize your job (use write on disk option for tmap, sort, ect) , avoid using live memory with buffer &amp;amp; hash component, read in several time, increase jvm params 
&lt;BR /&gt;my 2cents 
&lt;BR /&gt;regards 
&lt;BR /&gt;laurent</description>
      <pubDate>Tue, 03 Sep 2013 16:49:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/OutOfMemoryError-Java-heap-space/m-p/2315789#M86410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-03T16:49:31Z</dc:date>
    </item>
  </channel>
</rss>

