struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Plante <plan...@videotron.ca>
Subject Re: OT: OutOfMemory
Date Tue, 29 Nov 2005 03:54:44 GMT
I've considered it but the letters of the word are not necessarily adjacent
to one another, there can be letters in between and those letters aren't
known so replaceAll doesn't work..or at least it didn't when I tried for
something else.

replacing abc by def is no problem but is it supposed to work to replace
a.{2}b.{2}c by d.{2}b.{2}c? I tried something like that before and it didn't
work.

--------------------------------------
have you tried,
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String)

On 11/29/05, Eric Plante <plantee@videotron.ca> wrote:
>
> The only difference between StringBuilder and StringBuffer is that
> StringBuffer is synchronized...from what I read at least and yes I
> considered every other methods of String but I don't see any other ways to
> quickly grab substrings do you have suggestions?
>
> ------------------------------------------------
>
> 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 <plantee@videotron.ca> 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 <plantee@videotron.ca> 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 <plantee@videotron.ca>:
> > > > 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" <netsql@roomity.com>
> > > > 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: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Yujun Liang
> > yujun.liang@acm.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Yujun Liang
> yujun.liang@acm.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
Yujun Liang
yujun.liang@acm.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message