|
From: Stephen K. <st...@sp...> - 2007-08-06 08:03:39
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> The quick fix would be to process the file as a stream without transferring the whole file to memory.<br> <br> Have you tried running it directly as the user the service is running as.<br> <br> Try add the following to your code to make sure that your memory flags are indeed being used. I assume you set this in the wrapper.conf file.<br> <br> <font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono">R</font><font face="Courier New, Courier, mono" size="2">untime runtime = Runtime.getRuntime();<br> <strong><font color="#000080">long</font></strong> maxMemory = runtime.maxMemory(); <br> </font><font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2"><strong><font color="#000080">long</font></strong></font></font><font face="Courier New, Courier, mono" size="2"> allocatedMemory = runtime.totalMemory(); <br> </font><font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2"><strong><font color="#000080">long</font></strong></font></font><font face="Courier New, Courier, mono" size="2"> freeMemory = runtime.freeMemory(); <br> </font><font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2">System.out.println(<font color="#000080">"free memory: "</font> + </font><font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2">freeMemory</font></font><font face="Courier New, Courier, mono" size="2"> / <font color="#000080">1024</font>);</font><font face="Arial, Helvetica, sans-serif" size="2"> </font></font><br> <font face="Courier New, Courier, mono" size="2"> </font><font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2">System.out.println(<font color="#000080">"allocated memory: "</font> + </font><font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2">allocatedMemory</font></font><font face="Courier New, Courier, mono" size="2"> / <font color="#000080">1024</font>);</font><font face="Arial, Helvetica, sans-serif" size="2"> </font></font><br> <font face="Courier New, Courier, mono" size="2">System.out.println(<font color="#000080">"max memory: "</font> + </font><font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2">maxMemory</font></font><font face="Courier New, Courier, mono" size="2"> / <font color="#000080">1024</font>);<br> System.out.println(<font color="#000080">"total free memory: "</font> + (freeMemory + (maxMemory - allocatedMemory)) / <font color="#000080">1024</font>);</font></font><br> <br> Also try add<br> # Java Additional Parameters<br> wrapper.java.additional.1=-server<br> <br> <font face="Arial, Helvetica, sans-serif" size="2"><font face="Courier New, Courier, mono" size="2"><br> <br> HTH<br> Stephen<br> </font></font><br> Andrew Rhodes wrote: <blockquote cite="mid...@ma..." type="cite"> <div><span class="067531607-04082007"><font face="Arial" size="2">Hi,</font></span></div> <div><span class="067531607-04082007"></span> </div> <div><span class="067531607-04082007"><font face="Arial" size="2">I have a simple app which runs a timer task at scheduled intervals and reads files off of the file system into a byte array and then does some other processing (not relevant). When run as a service on a windows machine (using the simple wrapper method), I get an IOException - Insufficient system resources exist to complete the requested service for large files. Large seems to be anything above 66 Mb and always causes the same error message. I adjusted the jvm min/max to 64 and 512 (and 1024), with still the same result. The exception is thrown when reading the file into the byte array. It reads smaller files no problem. </font></span></div> <div><span class="067531607-04082007"></span> </div> <div><span class="067531607-04082007"><font face="Arial" size="2">I'm not sure if it is related to jsw, but I tested the same file reader function code outside jsw and could read a 320 Mb file Ok with same jvm params, hence why I posted this message. </font></span></div> <div><span class="067531607-04082007"></span> </div> <div><font face="Arial" size="2"><span class="067531607-04082007">Grateful for any thoughts on this.</span></font></div> <div><font face="Arial" size="2"><span class="067531607-04082007"></span></font> </div> <div><font face="Arial" size="2"><span class="067531607-04082007">Andy</span></font></div> <pre wrap=""> <hr size="4" width="90%"> ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> <a class="moz-txt-link-freetext" href="http://get.splunk.com/">http://get.splunk.com/</a></pre> <pre wrap=""> <hr size="4" width="90%"> _______________________________________________ Wrapper-user mailing list <a class="moz-txt-link-abbreviated" href="mailto:Wra...@li...">Wra...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/wrapper-user">https://lists.sourceforge.net/lists/listinfo/wrapper-user</a> </pre> </blockquote> </body> </html> |