Instead of using StringBuilder, did you consider using StringBuffer as an alternative? Have you check all the available method within String class itself?
On 11/29/05, Eric Plante <[EMAIL PROTECTED]> wrote: > > Because I need to insert a <font ...> tag in front of every letters of > every > found given word and a closing</font>. The word tested is 'create'(6 > letters) and it appears something like 830 times. > > After using a RegEx, I got the positions of those letters so I need > substrings of the main string to fill a StringBuilder with the parts not > containing the letters of the words. > > This loop is not there just to be fancy. > > ----------------------------------------------- > Well, if I wrote a recursive call which never returns, I could bring down > any system. Can you tell us why you need loop 5000 times? Instead of using > StringBuilder, did you consider using StringBuffer as an alternative? Have > you check all the available method within String class itself? > > This is the checklist I can think of for now, hope it helps. > > On 11/29/05, Eric Plante <[EMAIL PROTECTED]> wrote: > > > > It wasn't there but I added it and whatever I used -Xmx or -XX, it > didn't > > work. I wrote 100m for the -XX... > > > > I also checked again where I could optimized and where I could find > memory > > leakage. Reducing the number of string meant using StringBuilder's > > insert....the slowness of that command makes it not an option. I > couldn't > > find any memory leakage. > > > > Where the program systematicaly crash is a loop where I do a substring > of > > the big string everytime(about 5000 loops).I then fill a StringBuilder > > which > > will eventualy be bigger than the main string. That's the fastest way I > > can > > do what need to be done and it needs to be fast. > > > > I'm starting to loose faith in Java...I'll ask a friend that > > isa.NETspecialist to see if.NET has that problem too...a problem Java > > shouldn't have... > > > > ----------------------------------- > > > > I found in my catalina.bat: > > set JAVA_OPTS= > > Instead of that, use: > > set JAVA_OPTS=-XX:MaxPermSize=10m > > > > -Xmx512m seems only increase max size of heap rather than perm division. > > > > 2005/11/29, Eric Plante <[EMAIL PROTECTED]>: > > > I found the required catalina files and I see 4 lines with the > JAVA_OPTS > > > variable. I tried replacing JAVA_OPTS and then %JAVA_OPTS% by -Xmx512m > > in > > > the catalina.bat file but I still get the error message, what am I > > suppose > > > to do in that file? > > > > > > ----- Original Message ----- > > > From: "netsql" <[EMAIL PROTECTED]> > > > To: <user@struts.apache.org> > > > Sent: Sunday, November 27, 2005 10:09 PM > > > Subject: Re: OT: OutOfMemory > > > > > > > > > > > > > > http://tomcat.apache.org/faq/memory.html#adjust > > > > > > > > > > > > Eric Plante wrote: > > > > > I'm on windows XP and the only catalina files that might serve for > > > > > configuration are Catalina.properties and catalina.policy > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Yujun Liang > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Yujun Liang [EMAIL PROTECTED]