Maximum number of characters in a String?

Does anyone know if Strings are limited to a mximum number of characters? If so, what is the limit?Thanks!Flo
[137 byte] By [Kuttig] at [2007-9-26 5:24:47]
# 1
The limit is the memory on your system (and, if smaller, the maximum heap allocated for the JVM).
jsalonen at 2007-6-29 19:32:14 > top of Java-index,Archived Forums,Java Programming...
# 2
Thanks very much!Do you know, how I can set up the allocated memory vor the VM on a window-system?Flo
Kuttig at 2007-6-29 19:32:14 > top of Java-index,Archived Forums,Java Programming...
# 3
If using sun's java.exe you can use the -Xmx option. Example:java -Xmx128M ClassNamewill run the class with maximum heap size set to 128 megs.
jsalonen at 2007-6-29 19:32:15 > top of Java-index,Archived Forums,Java Programming...
# 4
Cool!can you also tell me how Browser handle the memory aspect? All I need is a maximum of 1MB for one temporary single String.
Kuttig at 2007-6-29 19:32:15 > top of Java-index,Archived Forums,Java Programming...
# 5
> can you also tell me how Browser handle the memory aspect? AFAIK, they don't.> All I need is a maximum of 1MB for one temporary single String.1MB should be small enough to fit in the memory... where do you get that string?
jsalonen at 2007-6-29 19:32:15 > top of Java-index,Archived Forums,Java Programming...
# 6
It is an XML-Description of a complex automation-Device sent via web. It's gonna be parsed after receiving.Thanks for your replies!Flo
Kuttig at 2007-6-29 19:32:15 > top of Java-index,Archived Forums,Java Programming...
# 7
Can't you parse it on the fly, while reading it? (if it still causes problems...)
jsalonen at 2007-6-29 19:32:15 > top of Java-index,Archived Forums,Java Programming...
# 8
That's a good suggestion, I think I will if I still get problems. Just that I think it is easier to pass a String Object to my parser-instance than connect it to an InputStream. Well, if I it is nescessary, I'll have to do this.Flo
Kuttig at 2007-6-29 19:32:15 > top of Java-index,Archived Forums,Java Programming...