RE: OT: OutOfMemory

2005-12-02 Thread Garner, Shawn
I would think he should use some kind of a buffered input stream and only
read in part of the data at once.

That way he would never have the entire string in the buffer at once.

Then open an output stream at the same time and write out the modified
contents to it.

This way I wouldn't think the buffer would have to be any more than three
times the length of the longest string you're searching for.

If you were searching for b*e*a*r your buffer would only need to be 3 times
the length of bear plus the max length of a * (there has to be some limit if
you look at actual data).

Shawn
-Original Message-
From: Chen Jerry [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 29, 2005 12:12 AM
To: Struts Users Mailing List
Subject: Re: OT: OutOfMemory

Rechard,

I suppose Eric wanna output HTML.

I myself prefer css to font tags. Introducing an XSLT engine is a nice
idea, however, it seems not the choice of Eric.

I suppose the current problem results from default configuration of
JVM or large numbers of substring with a big string.

Regards,

Jerry

2005/11/29, Richard Yee [EMAIL PROTECTED]:
 Jerry,
 Are you trying to output HTML? If so, you should consider:
 1) using CSS instead of the font tags
 2) use an XSLT transform or transform the text as you output it rather
 than doing it in memory.

 -Richard


 Jason Lea wrote:
  What is textFormat?
  It isn't a StringBuilder is it?
 
  textFormat.append(subText);
 
 
  Eric Plante wrote:
  for (Integer posLetter: positions){
  String subText = fullText.substring(start, posLetter);
  textFormat.append(subText);
  subText = null; //not required
  start = posLetter + 1;
  }
 
  with fullText = 5M and textFormat that's even bigger it crashes.
 
  An friend tried with a 15M file using Lingo language and it worked
  without
  problems and I bet .NET would have no problem either but I'll know
  tomorrow.
  
  Sorry to hear that.
 
  Would you please show some source code relative to the problem?
 
  Well, 5000 loops of substring with a big string is terrible.
 
  2005/11/29, Eric Plante [EMAIL PROTECTED]:
 
  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
  insertthe 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]
 
 
 
 
  -
  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

RE: OT: OutOfMemory

2005-11-29 Thread David G. Friedman
Eric,

Is this what you are looking for?  It is from the Exadel Forum site 
http://forum.exadel.com and the exadel HELP pages:

http://www.exadel.com/exadelstudio/help/servletToolbar.html

The toolbar under Running has a tomcat section where you should be able to 
add JVM arguments like the
-XX:MaxPermSize=10m one we are discussing. See the bottom screen 
capture/image in that page for a clear illustration.

Regards,
David

-Original Message-
From: Eric Plante [mailto:[EMAIL PROTECTED]
Sent: Monday, November 28, 2005 10:20 PM
To: Struts Users Mailing List
Subject: Re: OT: OutOfMemory


I'm using the internal Eclipse/Exadel Studio tomcat 5.5 but I think it uses
the same installed tomcat server since I should havelinked Eclipse to it but
it uses it own ser of xml files. I added 1024M to maximum memory but it
changed nothing. I couldn't find that 1024 in any xml files in the tomcat
directory...

-


From Taskbar, right click Tomcat5 Service Icon, click Configure.

On configure window, choose java tab, enter

Initial Memory Pool
Maximum Memory Pool.

Regards

On 11/29/05, Chen Jerry [EMAIL PROTECTED] wrote:

 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]




--
Yujun Liang
[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]



Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
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]



Re: OT: OutOfMemory

2005-11-28 Thread Chen Jerry
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]



Re: OT: OutOfMemory

2005-11-28 Thread Yujun Liang
From Taskbar, right click Tomcat5 Service Icon, click Configure.

On configure window, choose java tab, enter

Initial Memory Pool
Maximum Memory Pool.

Regards

On 11/29/05, Chen Jerry [EMAIL PROTECTED] wrote:

 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]




--
Yujun Liang
[EMAIL PROTECTED]


Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
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
insertthe 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]



Re: OT: OutOfMemory

2005-11-28 Thread Yujun Liang
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
 insertthe 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]


Re: OT: OutOfMemory

2005-11-28 Thread Chen Jerry
Sorry to hear that.

Would you please show some source code relative to the problem?

Well, 5000 loops of substring with a big string is terrible.

2005/11/29, Eric Plante [EMAIL PROTECTED]:
 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
 insertthe 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]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
I'm using the internal Eclipse/Exadel Studio tomcat 5.5 but I think it uses
the same installed tomcat server since I should havelinked Eclipse to it but
it uses it own ser of xml files. I added 1024M to maximum memory but it
changed nothing. I couldn't find that 1024 in any xml files in the tomcat
directory...

-


From Taskbar, right click Tomcat5 Service Icon, click Configure.

On configure window, choose java tab, enter

Initial Memory Pool
Maximum Memory Pool.

Regards

On 11/29/05, Chen Jerry [EMAIL PROTECTED] wrote:

 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]




--
Yujun Liang
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: OutOfMemory

2005-11-28 Thread Yujun Liang
Can you post your source code where you got the problem?

On 11/29/05, Eric Plante [EMAIL PROTECTED] wrote:

 I'm using the internal Eclipse/Exadel Studio tomcat 5.5 but I think it
 uses
 the same installed tomcat server since I should havelinked Eclipse to it
 but
 it uses it own ser of xml files. I added 1024M to maximum memory but it
 changed nothing. I couldn't find that 1024 in any xml files in the tomcat
 directory...

 -


 From Taskbar, right click Tomcat5 Service Icon, click Configure.

 On configure window, choose java tab, enter

 Initial Memory Pool
 Maximum Memory Pool.

 Regards

 On 11/29/05, Chen Jerry [EMAIL PROTECTED] wrote:
 
  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]
 
 


 --
 Yujun Liang
 [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Yujun Liang
[EMAIL PROTECTED]


Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
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
 insertthe 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]



Re: OT: OutOfMemory

2005-11-28 Thread Yujun Liang
 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
  insertthe 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]


Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
for (Integer posLetter: positions){
String subText = fullText.substring(start, posLetter);
textFormat.append(subText);
subText = null; //not required
start = posLetter + 1;
}

with fullText = 5M and textFormat that's even bigger it crashes.

An friend tried with a 15M file using Lingo language and it worked without
problems and I bet .NET would have no problem either but I'll know tomorrow.

Sorry to hear that.

Would you please show some source code relative to the problem?

Well, 5000 loops of substring with a big string is terrible.

2005/11/29, Eric Plante [EMAIL PROTECTED]:
 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
 insertthe 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]



-
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]



Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
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 [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
  insertthe 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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: OutOfMemory

2005-11-28 Thread Yujun Liang
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 [EMAIL PROTECTED] 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 [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
   insertthe 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]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Yujun Liang
[EMAIL PROTECTED]


Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
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 [EMAIL PROTECTED] 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 [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
   insertthe 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]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional

Re: OT: OutOfMemory

2005-11-28 Thread Chen Jerry
Well, to replace each 'create' with 'font color=redcreate/font',
you can leverage:

String origin = ...
String result = origin.replaceAll(create,font color =readcreate/font);

I am not sure whether this operation should result in the same problem.


2005/11/29, Eric Plante [EMAIL PROTECTED]:
 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 [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
   insertthe 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]


 -
 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]



Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
I guess I could try grabbing whole groups instead of their individual
letters then I'll have to modify each to add the tags and than do a
replacement for each...sounds like a slow process but I have nothing to lose
by trying that.

Thanks
--

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 [EMAIL PROTECTED] 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 [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
   insertthe 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]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Yujun Liang
[EMAIL PROTECTED

Re: OT: OutOfMemory

2005-11-28 Thread Eric Plante
if it was only that, it wouldn't be a problem but it's create, c*r*e*a*t*e,
c**r**e**a**t**e, etc

* represents any letters and it stops when the interval between letters is
reached.
--

Well, to replace each 'create' with 'font color=redcreate/font',
you can leverage:

String origin = ...
String result = origin.replaceAll(create,font color
=readcreate/font);

I am not sure whether this operation should result in the same problem.


2005/11/29, Eric Plante [EMAIL PROTECTED]:
 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 [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
   insertthe 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]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED

Re: OT: OutOfMemory

2005-11-28 Thread Chen Jerry
2005/11/29, Eric Plante [EMAIL PROTECTED]:
 for (Integer posLetter: positions){

Well, would you please post code relative to the variable of postions?

 String subText = fullText.substring(start, posLetter);
 textFormat.append(subText);
 subText = null; //not required
 start = posLetter + 1;
 }

 with fullText = 5M and textFormat that's even bigger it crashes.

 An friend tried with a 15M file using Lingo language and it worked without
 problems and I bet .NET would have no problem either but I'll know tomorrow.
 
 Sorry to hear that.

 Would you please show some source code relative to the problem?

 Well, 5000 loops of substring with a big string is terrible.

 2005/11/29, Eric Plante [EMAIL PROTECTED]:
  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
  insertthe 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]
 
 

 -
 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]



Re: OT: OutOfMemory

2005-11-28 Thread Jason Lea

What is textFormat?
It isn't a StringBuilder is it?

textFormat.append(subText);


Eric Plante wrote:

for (Integer posLetter: positions){
String subText = fullText.substring(start, posLetter);
textFormat.append(subText);
subText = null; //not required
start = posLetter + 1;
}

with fullText = 5M and textFormat that's even bigger it crashes.

An friend tried with a 15M file using Lingo language and it worked without
problems and I bet .NET would have no problem either but I'll know tomorrow.

Sorry to hear that.

Would you please show some source code relative to the problem?

Well, 5000 loops of substring with a big string is terrible.

2005/11/29, Eric Plante [EMAIL PROTECTED]:
  

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
insertthe 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]





-
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]


  


--
Jason Lea




Re: OT: OutOfMemory

2005-11-28 Thread Richard Yee

Jerry,
Are you trying to output HTML? If so, you should consider:
1) using CSS instead of the font tags
2) use an XSLT transform or transform the text as you output it rather 
than doing it in memory.


-Richard


Jason Lea wrote:

What is textFormat?
It isn't a StringBuilder is it?

textFormat.append(subText);


Eric Plante wrote:

for (Integer posLetter: positions){
String subText = fullText.substring(start, posLetter);
textFormat.append(subText);
subText = null; //not required
start = posLetter + 1;
}

with fullText = 5M and textFormat that's even bigger it crashes.

An friend tried with a 15M file using Lingo language and it worked 
without
problems and I bet .NET would have no problem either but I'll know 
tomorrow.


Sorry to hear that.

Would you please show some source code relative to the problem?

Well, 5000 loops of substring with a big string is terrible.

2005/11/29, Eric Plante [EMAIL PROTECTED]:
 
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
insertthe 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]





-
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]



Re: OT: OutOfMemory

2005-11-28 Thread Chen Jerry
Rechard,

I suppose Eric wanna output HTML.

I myself prefer css to font tags. Introducing an XSLT engine is a nice
idea, however, it seems not the choice of Eric.

I suppose the current problem results from default configuration of
JVM or large numbers of substring with a big string.

Regards,

Jerry

2005/11/29, Richard Yee [EMAIL PROTECTED]:
 Jerry,
 Are you trying to output HTML? If so, you should consider:
 1) using CSS instead of the font tags
 2) use an XSLT transform or transform the text as you output it rather
 than doing it in memory.

 -Richard


 Jason Lea wrote:
  What is textFormat?
  It isn't a StringBuilder is it?
 
  textFormat.append(subText);
 
 
  Eric Plante wrote:
  for (Integer posLetter: positions){
  String subText = fullText.substring(start, posLetter);
  textFormat.append(subText);
  subText = null; //not required
  start = posLetter + 1;
  }
 
  with fullText = 5M and textFormat that's even bigger it crashes.
 
  An friend tried with a 15M file using Lingo language and it worked
  without
  problems and I bet .NET would have no problem either but I'll know
  tomorrow.
  
  Sorry to hear that.
 
  Would you please show some source code relative to the problem?
 
  Well, 5000 loops of substring with a big string is terrible.
 
  2005/11/29, Eric Plante [EMAIL PROTECTED]:
 
  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
  insertthe 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]
 
 
 
 
  -
  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]



OT: OutOfMemory

2005-11-27 Thread Eric Plante
Hi,

I have a struts application(1.1) using Eclipse and Exadel Studio with tomcat
5.5.9 using Jave 5.0

I have to deal with a huge String in memory, about 5-6M and every time I run
my web application, I get java.OutOfMemoryError: java heap space...always at
the same place(I fill a StringBuilder with the main String + other strings
so I am effectively dealing with 2 huge strings at that point).

When I run my application with a smaller string, it works fine so I checked
for potential memory leak or bust but it seems to run just the minimum
strings and stringbuilder object the application requires and all the
objects should be destroyed properly.

I checked the web and all I could find was to try raising the heap space
exept that java -server -Xmx512m doesn't see any server and it doesn't seem
to be a good idea to raise the heap stack anyway but I saw a post saying
that Java 5.0 was using a proper heap size(1G although I don't have 1G RAM,
I suppose it uses what it can.)

I always thought that if there wasn't enough space in memory, applications
would use the HD as memory slowing down the application but at least it
wouldn't explode.

Any idea how my problem could be solved? Are there any memory obscure
restrictions to String and StringBuilder I should know that books doesn't
say? I just can't see how 2 5M String in memory could be that much of a
problem in 2005.

Thanks


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: OutOfMemory

2005-11-27 Thread Chen Jerry
Well, I suppose I can offer some tip that may help.

Let me suppose you use Hotspot VM.

Sun's Hotspot VM 's heap space consists of three divisions for young
generation, old generation and perminant generation. Young generation
refers to objects that are created and usually it died in a short
time. The corresponding division leverages copying to collect garbage.
When some object survives after several gc, It is moved to old
generation division, where mark-and-sweep is leveraged. And the
perminant gereration is where class objects reside, its default size
is 4M(I am not certain).

Well, in case of String s = ;  is put into division of
perminant generation. Your String is huge enough to exceed the size
limit and of course throws OutOfMemory error. You can increase only
the size of division of perminant generation to solve the problem by
specifying some -X option. I am sorry to say that I lose my notebook
the day before yesterday, so I cannot give any further tip.

Regards,

Jerry

2005/11/28, Eric Plante [EMAIL PROTECTED]:
 Hi,

 I have a struts application(1.1) using Eclipse and Exadel Studio with tomcat
 5.5.9 using Jave 5.0

 I have to deal with a huge String in memory, about 5-6M and every time I run
 my web application, I get java.OutOfMemoryError: java heap space...always at
 the same place(I fill a StringBuilder with the main String + other strings
 so I am effectively dealing with 2 huge strings at that point).

 When I run my application with a smaller string, it works fine so I checked
 for potential memory leak or bust but it seems to run just the minimum
 strings and stringbuilder object the application requires and all the
 objects should be destroyed properly.

 I checked the web and all I could find was to try raising the heap space
 exept that java -server -Xmx512m doesn't see any server and it doesn't seem
 to be a good idea to raise the heap stack anyway but I saw a post saying
 that Java 5.0 was using a proper heap size(1G although I don't have 1G RAM,
 I suppose it uses what it can.)

 I always thought that if there wasn't enough space in memory, applications
 would use the HD as memory slowing down the application but at least it
 wouldn't explode.

 Any idea how my problem could be solved? Are there any memory obscure
 restrictions to String and StringBuilder I should know that books doesn't
 say? I just can't see how 2 5M String in memory could be that much of a
 problem in 2005.

 Thanks


 -
 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]



Re: OT: OutOfMemory

2005-11-27 Thread Eric Plante
Thanks

1-How do I know if I use hotspot or not?
2-Is StringBuilder using the same heap as String?
3-What if I can't control the size of the Strings since they come from files
that can be as big as the HD memory?
4-Is there a way to use the Hard Drive memory instead of the stack?

--

Well, I suppose I can offer some tip that may help.

Let me suppose you use Hotspot VM.

Sun's Hotspot VM 's heap space consists of three divisions for young
generation, old generation and perminant generation. Young generation
refers to objects that are created and usually it died in a short
time. The corresponding division leverages copying to collect garbage.
When some object survives after several gc, It is moved to old
generation division, where mark-and-sweep is leveraged. And the
perminant gereration is where class objects reside, its default size
is 4M(I am not certain).

Well, in case of String s = ;  is put into division of
perminant generation. Your String is huge enough to exceed the size
limit and of course throws OutOfMemory error. You can increase only
the size of division of perminant generation to solve the problem by
specifying some -X option. I am sorry to say that I lose my notebook
the day before yesterday, so I cannot give any further tip.

Regards,

Jerry

2005/11/28, Eric Plante [EMAIL PROTECTED]:
 Hi,

 I have a struts application(1.1) using Eclipse and Exadel Studio with
tomcat
 5.5.9 using Jave 5.0

 I have to deal with a huge String in memory, about 5-6M and every time I
run
 my web application, I get java.OutOfMemoryError: java heap space...always
at
 the same place(I fill a StringBuilder with the main String + other strings
 so I am effectively dealing with 2 huge strings at that point).

 When I run my application with a smaller string, it works fine so I
checked
 for potential memory leak or bust but it seems to run just the minimum
 strings and stringbuilder object the application requires and all the
 objects should be destroyed properly.

 I checked the web and all I could find was to try raising the heap space
 exept that java -server -Xmx512m doesn't see any server and it doesn't
seem
 to be a good idea to raise the heap stack anyway but I saw a post saying
 that Java 5.0 was using a proper heap size(1G although I don't have 1G
RAM,
 I suppose it uses what it can.)

 I always thought that if there wasn't enough space in memory, applications
 would use the HD as memory slowing down the application but at least it
 wouldn't explode.

 Any idea how my problem could be solved? Are there any memory obscure
 restrictions to String and StringBuilder I should know that books doesn't
 say? I just can't see how 2 5M String in memory could be that much of a
 problem in 2005.

 Thanks


 -
 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]



Re: OT: OutOfMemory

2005-11-27 Thread Chen Jerry
Well, It's -XX:MaxPermSize option rather than some -X option; you can
refer to this link for more information:
http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf

Regards,

Jerry


2005/11/28, Chen Jerry [EMAIL PROTECTED]:
 Well, I suppose I can offer some tip that may help.

 Let me suppose you use Hotspot VM.

 Sun's Hotspot VM 's heap space consists of three divisions for young
 generation, old generation and perminant generation. Young generation
 refers to objects that are created and usually it died in a short
 time. The corresponding division leverages copying to collect garbage.
 When some object survives after several gc, It is moved to old
 generation division, where mark-and-sweep is leveraged. And the
 perminant gereration is where class objects reside, its default size
 is 4M(I am not certain).

 Well, in case of String s = ;  is put into division of
 perminant generation. Your String is huge enough to exceed the size
 limit and of course throws OutOfMemory error. You can increase only
 the size of division of perminant generation to solve the problem by
 specifying some -X option. I am sorry to say that I lose my notebook
 the day before yesterday, so I cannot give any further tip.

 Regards,

 Jerry

 2005/11/28, Eric Plante [EMAIL PROTECTED]:
  Hi,
 
  I have a struts application(1.1) using Eclipse and Exadel Studio with tomcat
  5.5.9 using Jave 5.0
 
  I have to deal with a huge String in memory, about 5-6M and every time I run
  my web application, I get java.OutOfMemoryError: java heap space...always at
  the same place(I fill a StringBuilder with the main String + other strings
  so I am effectively dealing with 2 huge strings at that point).
 
  When I run my application with a smaller string, it works fine so I checked
  for potential memory leak or bust but it seems to run just the minimum
  strings and stringbuilder object the application requires and all the
  objects should be destroyed properly.
 
  I checked the web and all I could find was to try raising the heap space
  exept that java -server -Xmx512m doesn't see any server and it doesn't seem
  to be a good idea to raise the heap stack anyway but I saw a post saying
  that Java 5.0 was using a proper heap size(1G although I don't have 1G RAM,
  I suppose it uses what it can.)
 
  I always thought that if there wasn't enough space in memory, applications
  would use the HD as memory slowing down the application but at least it
  wouldn't explode.
 
  Any idea how my problem could be solved? Are there any memory obscure
  restrictions to String and StringBuilder I should know that books doesn't
  say? I just can't see how 2 5M String in memory could be that much of a
  problem in 2005.
 
  Thanks
 
 
  -
  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]



Re: OT: OutOfMemory

2005-11-27 Thread Chen Jerry
2005/11/28, Eric Plante [EMAIL PROTECTED]:
 Thanks

 1-How do I know if I use hotspot or not?
$ java -version

 2-Is StringBuilder using the same heap as String?

xxx is regard as permniant object. does your StringBuilder leverages
sb.append(xxx)?
If so, I suppose it is the same to String s=xxx;sb.append(s);
 3-What if I can't control the size of the Strings since they come from files
 that can be as big as the HD memory?
String loaded seems not to be deal with in the same way as String s = xxx

 4-Is there a way to use the Hard Drive memory instead of the stack?
I have no idea what is Hard Drive memory, sorry.
and stack differs from heap, both differ from physical memory.


 --

 Well, I suppose I can offer some tip that may help.

 Let me suppose you use Hotspot VM.

 Sun's Hotspot VM 's heap space consists of three divisions for young
 generation, old generation and perminant generation. Young generation
 refers to objects that are created and usually it died in a short
 time. The corresponding division leverages copying to collect garbage.
 When some object survives after several gc, It is moved to old
 generation division, where mark-and-sweep is leveraged. And the
 perminant gereration is where class objects reside, its default size
 is 4M(I am not certain).

 Well, in case of String s = ;  is put into division of
 perminant generation. Your String is huge enough to exceed the size
 limit and of course throws OutOfMemory error. You can increase only
 the size of division of perminant generation to solve the problem by
 specifying some -X option. I am sorry to say that I lose my notebook
 the day before yesterday, so I cannot give any further tip.

 Regards,

 Jerry

 2005/11/28, Eric Plante [EMAIL PROTECTED]:
  Hi,
 
  I have a struts application(1.1) using Eclipse and Exadel Studio with
 tomcat
  5.5.9 using Jave 5.0
 
  I have to deal with a huge String in memory, about 5-6M and every time I
 run
  my web application, I get java.OutOfMemoryError: java heap space...always
 at
  the same place(I fill a StringBuilder with the main String + other strings
  so I am effectively dealing with 2 huge strings at that point).
 
  When I run my application with a smaller string, it works fine so I
 checked
  for potential memory leak or bust but it seems to run just the minimum
  strings and stringbuilder object the application requires and all the
  objects should be destroyed properly.
 
  I checked the web and all I could find was to try raising the heap space
  exept that java -server -Xmx512m doesn't see any server and it doesn't
 seem
  to be a good idea to raise the heap stack anyway but I saw a post saying
  that Java 5.0 was using a proper heap size(1G although I don't have 1G
 RAM,
  I suppose it uses what it can.)
 
  I always thought that if there wasn't enough space in memory, applications
  would use the HD as memory slowing down the application but at least it
  wouldn't explode.
 
  Any idea how my problem could be solved? Are there any memory obscure
  restrictions to String and StringBuilder I should know that books doesn't
  say? I just can't see how 2 5M String in memory could be that much of a
  problem in 2005.
 
  Thanks
 
 
  -
  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]



Re: OT: OutOfMemory

2005-11-27 Thread Eric Plante
It uses hotspot.

I don't append litteral strings but I append substrings of a String object
in my StringBuilders.

By HD memory I meant physical.

If I understand well, there is no solution to my problem, I will always be
limited to the heap size? That really troublesome, it should use the
physical memory when the heap overload.

Thanks

2005/11/28, Eric Plante [EMAIL PROTECTED]:
 Thanks

 1-How do I know if I use hotspot or not?
$ java -version

 2-Is StringBuilder using the same heap as String?

xxx is regard as permniant object. does your StringBuilder leverages
sb.append(xxx)?
If so, I suppose it is the same to String s=xxx;sb.append(s);
 3-What if I can't control the size of the Strings since they come from
files
 that can be as big as the HD memory?
String loaded seems not to be deal with in the same way as String s = xxx

 4-Is there a way to use the Hard Drive memory instead of the stack?
I have no idea what is Hard Drive memory, sorry.
and stack differs from heap, both differ from physical memory.


 --

 Well, I suppose I can offer some tip that may help.

 Let me suppose you use Hotspot VM.

 Sun's Hotspot VM 's heap space consists of three divisions for young
 generation, old generation and perminant generation. Young generation
 refers to objects that are created and usually it died in a short
 time. The corresponding division leverages copying to collect garbage.
 When some object survives after several gc, It is moved to old
 generation division, where mark-and-sweep is leveraged. And the
 perminant gereration is where class objects reside, its default size
 is 4M(I am not certain).

 Well, in case of String s = ;  is put into division of
 perminant generation. Your String is huge enough to exceed the size
 limit and of course throws OutOfMemory error. You can increase only
 the size of division of perminant generation to solve the problem by
 specifying some -X option. I am sorry to say that I lose my notebook
 the day before yesterday, so I cannot give any further tip.

 Regards,

 Jerry

 2005/11/28, Eric Plante [EMAIL PROTECTED]:
  Hi,
 
  I have a struts application(1.1) using Eclipse and Exadel Studio with
 tomcat
  5.5.9 using Jave 5.0
 
  I have to deal with a huge String in memory, about 5-6M and every time I
 run
  my web application, I get java.OutOfMemoryError: java heap
space...always
 at
  the same place(I fill a StringBuilder with the main String + other
strings
  so I am effectively dealing with 2 huge strings at that point).
 
  When I run my application with a smaller string, it works fine so I
 checked
  for potential memory leak or bust but it seems to run just the minimum
  strings and stringbuilder object the application requires and all the
  objects should be destroyed properly.
 
  I checked the web and all I could find was to try raising the heap space
  exept that java -server -Xmx512m doesn't see any server and it doesn't
 seem
  to be a good idea to raise the heap stack anyway but I saw a post saying
  that Java 5.0 was using a proper heap size(1G although I don't have 1G
 RAM,
  I suppose it uses what it can.)
 
  I always thought that if there wasn't enough space in memory,
applications
  would use the HD as memory slowing down the application but at least it
  wouldn't explode.
 
  Any idea how my problem could be solved? Are there any memory obscure
  restrictions to String and StringBuilder I should know that books
doesn't
  say? I just can't see how 2 5M String in memory could be that much of a
  problem in 2005.
 
  Thanks
 
 
  -
  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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: OutOfMemory

2005-11-27 Thread Chen Jerry
Well, heap size and each division has its default value. In fact, they
are specified proper values, such as minimal size, maximal size,
ratio, etc., according to requirement. Did you try customizing memory
model of Hotspot at application startup? I suppose your problem can be
solved by increase the maximal size of perm division at startup.
You can start up app as follows, but I am not sure:
java -XX:MaxPermSize=10m app

2005/11/28, Eric Plante [EMAIL PROTECTED]:
 It uses hotspot.

 I don't append litteral strings but I append substrings of a String object
 in my StringBuilders.

 By HD memory I meant physical.

 If I understand well, there is no solution to my problem, I will always be
 limited to the heap size? That really troublesome, it should use the
 physical memory when the heap overload.

 Thanks

 2005/11/28, Eric Plante [EMAIL PROTECTED]:
  Thanks
 
  1-How do I know if I use hotspot or not?
 $ java -version

  2-Is StringBuilder using the same heap as String?

 xxx is regard as permniant object. does your StringBuilder leverages
 sb.append(xxx)?
 If so, I suppose it is the same to String s=xxx;sb.append(s);
  3-What if I can't control the size of the Strings since they come from
 files
  that can be as big as the HD memory?
 String loaded seems not to be deal with in the same way as String s = xxx

  4-Is there a way to use the Hard Drive memory instead of the stack?
 I have no idea what is Hard Drive memory, sorry.
 and stack differs from heap, both differ from physical memory.

 
  --
 
  Well, I suppose I can offer some tip that may help.
 
  Let me suppose you use Hotspot VM.
 
  Sun's Hotspot VM 's heap space consists of three divisions for young
  generation, old generation and perminant generation. Young generation
  refers to objects that are created and usually it died in a short
  time. The corresponding division leverages copying to collect garbage.
  When some object survives after several gc, It is moved to old
  generation division, where mark-and-sweep is leveraged. And the
  perminant gereration is where class objects reside, its default size
  is 4M(I am not certain).
 
  Well, in case of String s = ;  is put into division of
  perminant generation. Your String is huge enough to exceed the size
  limit and of course throws OutOfMemory error. You can increase only
  the size of division of perminant generation to solve the problem by
  specifying some -X option. I am sorry to say that I lose my notebook
  the day before yesterday, so I cannot give any further tip.
 
  Regards,
 
  Jerry
 
  2005/11/28, Eric Plante [EMAIL PROTECTED]:
   Hi,
  
   I have a struts application(1.1) using Eclipse and Exadel Studio with
  tomcat
   5.5.9 using Jave 5.0
  
   I have to deal with a huge String in memory, about 5-6M and every time I
  run
   my web application, I get java.OutOfMemoryError: java heap
 space...always
  at
   the same place(I fill a StringBuilder with the main String + other
 strings
   so I am effectively dealing with 2 huge strings at that point).
  
   When I run my application with a smaller string, it works fine so I
  checked
   for potential memory leak or bust but it seems to run just the minimum
   strings and stringbuilder object the application requires and all the
   objects should be destroyed properly.
  
   I checked the web and all I could find was to try raising the heap space
   exept that java -server -Xmx512m doesn't see any server and it doesn't
  seem
   to be a good idea to raise the heap stack anyway but I saw a post saying
   that Java 5.0 was using a proper heap size(1G although I don't have 1G
  RAM,
   I suppose it uses what it can.)
  
   I always thought that if there wasn't enough space in memory,
 applications
   would use the HD as memory slowing down the application but at least it
   wouldn't explode.
  
   Any idea how my problem could be solved? Are there any memory obscure
   restrictions to String and StringBuilder I should know that books
 doesn't
   say? I just can't see how 2 5M String in memory could be that much of a
   problem in 2005.
  
   Thanks
  
  
   -
   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]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, 

Re: OT: OutOfMemory

2005-11-27 Thread Chen Jerry
Well, you use tomcat, right?
There is bin/catalina.bat, where you can specify -XX options.

2005/11/28, Chen Jerry [EMAIL PROTECTED]:
 Well, heap size and each division has its default value. In fact, they
 are specified proper values, such as minimal size, maximal size,
 ratio, etc., according to requirement. Did you try customizing memory
 model of Hotspot at application startup? I suppose your problem can be
 solved by increase the maximal size of perm division at startup.
 You can start up app as follows, but I am not sure:
 java -XX:MaxPermSize=10m app

 2005/11/28, Eric Plante [EMAIL PROTECTED]:
  It uses hotspot.
 
  I don't append litteral strings but I append substrings of a String object
  in my StringBuilders.
 
  By HD memory I meant physical.
 
  If I understand well, there is no solution to my problem, I will always be
  limited to the heap size? That really troublesome, it should use the
  physical memory when the heap overload.
 
  Thanks
 
  2005/11/28, Eric Plante [EMAIL PROTECTED]:
   Thanks
  
   1-How do I know if I use hotspot or not?
  $ java -version
 
   2-Is StringBuilder using the same heap as String?
 
  xxx is regard as permniant object. does your StringBuilder leverages
  sb.append(xxx)?
  If so, I suppose it is the same to String s=xxx;sb.append(s);
   3-What if I can't control the size of the Strings since they come from
  files
   that can be as big as the HD memory?
  String loaded seems not to be deal with in the same way as String s = xxx
 
   4-Is there a way to use the Hard Drive memory instead of the stack?
  I have no idea what is Hard Drive memory, sorry.
  and stack differs from heap, both differ from physical memory.
 
  
   --
  
   Well, I suppose I can offer some tip that may help.
  
   Let me suppose you use Hotspot VM.
  
   Sun's Hotspot VM 's heap space consists of three divisions for young
   generation, old generation and perminant generation. Young generation
   refers to objects that are created and usually it died in a short
   time. The corresponding division leverages copying to collect garbage.
   When some object survives after several gc, It is moved to old
   generation division, where mark-and-sweep is leveraged. And the
   perminant gereration is where class objects reside, its default size
   is 4M(I am not certain).
  
   Well, in case of String s = ;  is put into division of
   perminant generation. Your String is huge enough to exceed the size
   limit and of course throws OutOfMemory error. You can increase only
   the size of division of perminant generation to solve the problem by
   specifying some -X option. I am sorry to say that I lose my notebook
   the day before yesterday, so I cannot give any further tip.
  
   Regards,
  
   Jerry
  
   2005/11/28, Eric Plante [EMAIL PROTECTED]:
Hi,
   
I have a struts application(1.1) using Eclipse and Exadel Studio with
   tomcat
5.5.9 using Jave 5.0
   
I have to deal with a huge String in memory, about 5-6M and every time I
   run
my web application, I get java.OutOfMemoryError: java heap
  space...always
   at
the same place(I fill a StringBuilder with the main String + other
  strings
so I am effectively dealing with 2 huge strings at that point).
   
When I run my application with a smaller string, it works fine so I
   checked
for potential memory leak or bust but it seems to run just the minimum
strings and stringbuilder object the application requires and all the
objects should be destroyed properly.
   
I checked the web and all I could find was to try raising the heap space
exept that java -server -Xmx512m doesn't see any server and it doesn't
   seem
to be a good idea to raise the heap stack anyway but I saw a post saying
that Java 5.0 was using a proper heap size(1G although I don't have 1G
   RAM,
I suppose it uses what it can.)
   
I always thought that if there wasn't enough space in memory,
  applications
would use the HD as memory slowing down the application but at least it
wouldn't explode.
   
Any idea how my problem could be solved? Are there any memory obscure
restrictions to String and StringBuilder I should know that books
  doesn't
say? I just can't see how 2 5M String in memory could be that much of a
problem in 2005.
   
Thanks
   
   
-
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]
  
  
 
  

Re: OT: OutOfMemory

2005-11-27 Thread Chen Jerry
if your os is linux and like, it is bin/catalina.sh

2005/11/28, Chen Jerry [EMAIL PROTECTED]:
 Well, you use tomcat, right?
 There is bin/catalina.bat, where you can specify -XX options.

 2005/11/28, Chen Jerry [EMAIL PROTECTED]:
  Well, heap size and each division has its default value. In fact, they
  are specified proper values, such as minimal size, maximal size,
  ratio, etc., according to requirement. Did you try customizing memory
  model of Hotspot at application startup? I suppose your problem can be
  solved by increase the maximal size of perm division at startup.
  You can start up app as follows, but I am not sure:
  java -XX:MaxPermSize=10m app
 
  2005/11/28, Eric Plante [EMAIL PROTECTED]:
   It uses hotspot.
  
   I don't append litteral strings but I append substrings of a String object
   in my StringBuilders.
  
   By HD memory I meant physical.
  
   If I understand well, there is no solution to my problem, I will always be
   limited to the heap size? That really troublesome, it should use the
   physical memory when the heap overload.
  
   Thanks
  
   2005/11/28, Eric Plante [EMAIL PROTECTED]:
Thanks
   
1-How do I know if I use hotspot or not?
   $ java -version
  
2-Is StringBuilder using the same heap as String?
  
   xxx is regard as permniant object. does your StringBuilder leverages
   sb.append(xxx)?
   If so, I suppose it is the same to String s=xxx;sb.append(s);
3-What if I can't control the size of the Strings since they come from
   files
that can be as big as the HD memory?
   String loaded seems not to be deal with in the same way as String s = 
   xxx
  
4-Is there a way to use the Hard Drive memory instead of the stack?
   I have no idea what is Hard Drive memory, sorry.
   and stack differs from heap, both differ from physical memory.
  
   
--
   
Well, I suppose I can offer some tip that may help.
   
Let me suppose you use Hotspot VM.
   
Sun's Hotspot VM 's heap space consists of three divisions for young
generation, old generation and perminant generation. Young generation
refers to objects that are created and usually it died in a short
time. The corresponding division leverages copying to collect garbage.
When some object survives after several gc, It is moved to old
generation division, where mark-and-sweep is leveraged. And the
perminant gereration is where class objects reside, its default size
is 4M(I am not certain).
   
Well, in case of String s = ;  is put into division of
perminant generation. Your String is huge enough to exceed the size
limit and of course throws OutOfMemory error. You can increase only
the size of division of perminant generation to solve the problem by
specifying some -X option. I am sorry to say that I lose my notebook
the day before yesterday, so I cannot give any further tip.
   
Regards,
   
Jerry
   
2005/11/28, Eric Plante [EMAIL PROTECTED]:
 Hi,

 I have a struts application(1.1) using Eclipse and Exadel Studio with
tomcat
 5.5.9 using Jave 5.0

 I have to deal with a huge String in memory, about 5-6M and every 
 time I
run
 my web application, I get java.OutOfMemoryError: java heap
   space...always
at
 the same place(I fill a StringBuilder with the main String + other
   strings
 so I am effectively dealing with 2 huge strings at that point).

 When I run my application with a smaller string, it works fine so I
checked
 for potential memory leak or bust but it seems to run just the minimum
 strings and stringbuilder object the application requires and all the
 objects should be destroyed properly.

 I checked the web and all I could find was to try raising the heap 
 space
 exept that java -server -Xmx512m doesn't see any server and it doesn't
seem
 to be a good idea to raise the heap stack anyway but I saw a post 
 saying
 that Java 5.0 was using a proper heap size(1G although I don't have 1G
RAM,
 I suppose it uses what it can.)

 I always thought that if there wasn't enough space in memory,
   applications
 would use the HD as memory slowing down the application but at least 
 it
 wouldn't explode.

 Any idea how my problem could be solved? Are there any memory obscure
 restrictions to String and StringBuilder I should know that books
   doesn't
 say? I just can't see how 2 5M String in memory could be that much of 
 a
 problem in 2005.

 Thanks


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, 

Re: OT: OutOfMemory

2005-11-27 Thread Eric Plante
Well, since it's a wab appliation, it starts with Tomcat server, not java
but anyway, MaxPermSize doesn't seem to exist
I tried adding jvm-option in server.xml but it either didn't work or
didn't recognize the property.

--

Well, heap size and each division has its default value. In fact, they
are specified proper values, such as minimal size, maximal size,
ratio, etc., according to requirement. Did you try customizing memory
model of Hotspot at application startup? I suppose your problem can be
solved by increase the maximal size of perm division at startup.
You can start up app as follows, but I am not sure:
java -XX:MaxPermSize=10m app

2005/11/28, Eric Plante [EMAIL PROTECTED]:
 It uses hotspot.

 I don't append litteral strings but I append substrings of a String object
 in my StringBuilders.

 By HD memory I meant physical.

 If I understand well, there is no solution to my problem, I will always be
 limited to the heap size? That really troublesome, it should use the
 physical memory when the heap overload.

 Thanks

 2005/11/28, Eric Plante [EMAIL PROTECTED]:
  Thanks
 
  1-How do I know if I use hotspot or not?
 $ java -version

  2-Is StringBuilder using the same heap as String?

 xxx is regard as permniant object. does your StringBuilder leverages
 sb.append(xxx)?
 If so, I suppose it is the same to String s=xxx;sb.append(s);
  3-What if I can't control the size of the Strings since they come from
 files
  that can be as big as the HD memory?
 String loaded seems not to be deal with in the same way as String s =
xxx

  4-Is there a way to use the Hard Drive memory instead of the stack?
 I have no idea what is Hard Drive memory, sorry.
 and stack differs from heap, both differ from physical memory.

 
  --
 
  Well, I suppose I can offer some tip that may help.
 
  Let me suppose you use Hotspot VM.
 
  Sun's Hotspot VM 's heap space consists of three divisions for young
  generation, old generation and perminant generation. Young generation
  refers to objects that are created and usually it died in a short
  time. The corresponding division leverages copying to collect garbage.
  When some object survives after several gc, It is moved to old
  generation division, where mark-and-sweep is leveraged. And the
  perminant gereration is where class objects reside, its default size
  is 4M(I am not certain).
 
  Well, in case of String s = ;  is put into division of
  perminant generation. Your String is huge enough to exceed the size
  limit and of course throws OutOfMemory error. You can increase only
  the size of division of perminant generation to solve the problem by
  specifying some -X option. I am sorry to say that I lose my notebook
  the day before yesterday, so I cannot give any further tip.
 
  Regards,
 
  Jerry
 
  2005/11/28, Eric Plante [EMAIL PROTECTED]:
   Hi,
  
   I have a struts application(1.1) using Eclipse and Exadel Studio with
  tomcat
   5.5.9 using Jave 5.0
  
   I have to deal with a huge String in memory, about 5-6M and every time
I
  run
   my web application, I get java.OutOfMemoryError: java heap
 space...always
  at
   the same place(I fill a StringBuilder with the main String + other
 strings
   so I am effectively dealing with 2 huge strings at that point).
  
   When I run my application with a smaller string, it works fine so I
  checked
   for potential memory leak or bust but it seems to run just the minimum
   strings and stringbuilder object the application requires and all the
   objects should be destroyed properly.
  
   I checked the web and all I could find was to try raising the heap
space
   exept that java -server -Xmx512m doesn't see any server and it doesn't
  seem
   to be a good idea to raise the heap stack anyway but I saw a post
saying
   that Java 5.0 was using a proper heap size(1G although I don't have 1G
  RAM,
   I suppose it uses what it can.)
  
   I always thought that if there wasn't enough space in memory,
 applications
   would use the HD as memory slowing down the application but at least
it
   wouldn't explode.
  
   Any idea how my problem could be solved? Are there any memory obscure
   restrictions to String and StringBuilder I should know that books
 doesn't
   say? I just can't see how 2 5M String in memory could be that much of
a
   problem in 2005.
  
   Thanks
  
  
   -
   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]
 
 

 

Re: OT: OutOfMemory

2005-11-27 Thread Eric Plante
I'm on windows XP and the only catalina files that might serve for
configuration are Catalina.properties and catalina.policy

In catalina.properties, there is those lines:

tomcat.util.buf.StringCache.byte.enabled=true
#tomcat.util.buf.StringCache.char.enabled=true
#tomcat.util.buf.StringCache.trainThreshold=50
#tomcat.util.buf.StringCache.cacheSize=5000

Is there anything there I can modify to help?

Thanks



if your os is linux and like, it is bin/catalina.sh

2005/11/28, Chen Jerry [EMAIL PROTECTED]:
 Well, you use tomcat, right?
 There is bin/catalina.bat, where you can specify -XX options.

 2005/11/28, Chen Jerry [EMAIL PROTECTED]:
  Well, heap size and each division has its default value. In fact, they
  are specified proper values, such as minimal size, maximal size,
  ratio, etc., according to requirement. Did you try customizing memory
  model of Hotspot at application startup? I suppose your problem can be
  solved by increase the maximal size of perm division at startup.
  You can start up app as follows, but I am not sure:
  java -XX:MaxPermSize=10m app
 
  2005/11/28, Eric Plante [EMAIL PROTECTED]:
   It uses hotspot.
  
   I don't append litteral strings but I append substrings of a String
object
   in my StringBuilders.
  
   By HD memory I meant physical.
  
   If I understand well, there is no solution to my problem, I will
always be
   limited to the heap size? That really troublesome, it should use the
   physical memory when the heap overload.
  
   Thanks
  
   2005/11/28, Eric Plante [EMAIL PROTECTED]:
Thanks
   
1-How do I know if I use hotspot or not?
   $ java -version
  
2-Is StringBuilder using the same heap as String?
  
   xxx is regard as permniant object. does your StringBuilder leverages
   sb.append(xxx)?
   If so, I suppose it is the same to String s=xxx;sb.append(s);
3-What if I can't control the size of the Strings since they come
from
   files
that can be as big as the HD memory?
   String loaded seems not to be deal with in the same way as String s =
xxx
  
4-Is there a way to use the Hard Drive memory instead of the stack?
   I have no idea what is Hard Drive memory, sorry.
   and stack differs from heap, both differ from physical memory.
  
   
--
   
Well, I suppose I can offer some tip that may help.
   
Let me suppose you use Hotspot VM.
   
Sun's Hotspot VM 's heap space consists of three divisions for young
generation, old generation and perminant generation. Young
generation
refers to objects that are created and usually it died in a short
time. The corresponding division leverages copying to collect
garbage.
When some object survives after several gc, It is moved to old
generation division, where mark-and-sweep is leveraged. And the
perminant gereration is where class objects reside, its default size
is 4M(I am not certain).
   
Well, in case of String s = ;  is put into division of
perminant generation. Your String is huge enough to exceed the size
limit and of course throws OutOfMemory error. You can increase only
the size of division of perminant generation to solve the problem by
specifying some -X option. I am sorry to say that I lose my notebook
the day before yesterday, so I cannot give any further tip.
   
Regards,
   
Jerry
   
2005/11/28, Eric Plante [EMAIL PROTECTED]:
 Hi,

 I have a struts application(1.1) using Eclipse and Exadel Studio
with
tomcat
 5.5.9 using Jave 5.0

 I have to deal with a huge String in memory, about 5-6M and every
time I
run
 my web application, I get java.OutOfMemoryError: java heap
   space...always
at
 the same place(I fill a StringBuilder with the main String + other
   strings
 so I am effectively dealing with 2 huge strings at that point).

 When I run my application with a smaller string, it works fine so
I
checked
 for potential memory leak or bust but it seems to run just the
minimum
 strings and stringbuilder object the application requires and all
the
 objects should be destroyed properly.

 I checked the web and all I could find was to try raising the heap
space
 exept that java -server -Xmx512m doesn't see any server and it
doesn't
seem
 to be a good idea to raise the heap stack anyway but I saw a post
saying
 that Java 5.0 was using a proper heap size(1G although I don't
have 1G
RAM,
 I suppose it uses what it can.)

 I always thought that if there wasn't enough space in memory,
   applications
 would use the HD as memory slowing down the application but at
least it
 wouldn't explode.

 Any idea how my problem could be solved? Are there any memory
obscure
 restrictions to String and StringBuilder I should know that books
   doesn't
 say? I just can't see how 2 5M 

Re: OT: OutOfMemory

2005-11-27 Thread Chen Jerry
Well,  I don't think configuration of properties and policy files
helps. But I am not sure. Why not try it out?

tomcat/bin/catalina.bat is for java options configuration, you can
find something like JAVA_OPTS, append -XX:MaxPermSize=10m (10m is my
choice in the fly, please replace it with your choice) with prefix
space and suffix space. And if you start tomcat with graphical
interface, when catalina.bat does not works, there's some tab in the
UI alllowing the corresponding configuration.

2005/11/28, Eric Plante [EMAIL PROTECTED]:
 I'm on windows XP and the only catalina files that might serve for
 configuration are Catalina.properties and catalina.policy

 In catalina.properties, there is those lines:

 tomcat.util.buf.StringCache.byte.enabled=true
 #tomcat.util.buf.StringCache.char.enabled=true
 #tomcat.util.buf.StringCache.trainThreshold=50
 #tomcat.util.buf.StringCache.cacheSize=5000

 Is there anything there I can modify to help?

 Thanks

 

 if your os is linux and like, it is bin/catalina.sh

 2005/11/28, Chen Jerry [EMAIL PROTECTED]:
  Well, you use tomcat, right?
  There is bin/catalina.bat, where you can specify -XX options.
 
  2005/11/28, Chen Jerry [EMAIL PROTECTED]:
   Well, heap size and each division has its default value. In fact, they
   are specified proper values, such as minimal size, maximal size,
   ratio, etc., according to requirement. Did you try customizing memory
   model of Hotspot at application startup? I suppose your problem can be
   solved by increase the maximal size of perm division at startup.
   You can start up app as follows, but I am not sure:
   java -XX:MaxPermSize=10m app
  
   2005/11/28, Eric Plante [EMAIL PROTECTED]:
It uses hotspot.
   
I don't append litteral strings but I append substrings of a String
 object
in my StringBuilders.
   
By HD memory I meant physical.
   
If I understand well, there is no solution to my problem, I will
 always be
limited to the heap size? That really troublesome, it should use the
physical memory when the heap overload.
   
Thanks
   
2005/11/28, Eric Plante [EMAIL PROTECTED]:
 Thanks

 1-How do I know if I use hotspot or not?
$ java -version
   
 2-Is StringBuilder using the same heap as String?
   
xxx is regard as permniant object. does your StringBuilder leverages
sb.append(xxx)?
If so, I suppose it is the same to String s=xxx;sb.append(s);
 3-What if I can't control the size of the Strings since they come
 from
files
 that can be as big as the HD memory?
String loaded seems not to be deal with in the same way as String s =
 xxx
   
 4-Is there a way to use the Hard Drive memory instead of the stack?
I have no idea what is Hard Drive memory, sorry.
and stack differs from heap, both differ from physical memory.
   

 --

 Well, I suppose I can offer some tip that may help.

 Let me suppose you use Hotspot VM.

 Sun's Hotspot VM 's heap space consists of three divisions for young
 generation, old generation and perminant generation. Young
 generation
 refers to objects that are created and usually it died in a short
 time. The corresponding division leverages copying to collect
 garbage.
 When some object survives after several gc, It is moved to old
 generation division, where mark-and-sweep is leveraged. And the
 perminant gereration is where class objects reside, its default size
 is 4M(I am not certain).

 Well, in case of String s = ;  is put into division of
 perminant generation. Your String is huge enough to exceed the size
 limit and of course throws OutOfMemory error. You can increase only
 the size of division of perminant generation to solve the problem by
 specifying some -X option. I am sorry to say that I lose my notebook
 the day before yesterday, so I cannot give any further tip.

 Regards,

 Jerry

 2005/11/28, Eric Plante [EMAIL PROTECTED]:
  Hi,
 
  I have a struts application(1.1) using Eclipse and Exadel Studio
 with
 tomcat
  5.5.9 using Jave 5.0
 
  I have to deal with a huge String in memory, about 5-6M and every
 time I
 run
  my web application, I get java.OutOfMemoryError: java heap
space...always
 at
  the same place(I fill a StringBuilder with the main String + other
strings
  so I am effectively dealing with 2 huge strings at that point).
 
  When I run my application with a smaller string, it works fine so
 I
 checked
  for potential memory leak or bust but it seems to run just the
 minimum
  strings and stringbuilder object the application requires and all
 the
  objects should be destroyed properly.
 
  I checked the web and all I could find was to try raising the heap
 space
  exept 

Re: OT: OutOfMemory

2005-11-27 Thread netsql


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]