well just as curious as i am i tried when my system couldn`t handle it
annymore
Acer 1524 WLMI Laptop ( Desktop replacement )
AMD 64 3400 +
Windows Server 2003 X64
1,2 GB of memory
running in visual studio 2003
this is still running
Dim s As New String("a", 490000000)
500000000 will raise an error ( out of memorry )
490.000.000 that is pretty much more as you :-)
now in Visula studio 2005 in x64 mode
this is still running
Dim s As New String("a", 1000000000)
however this raises the out of memory exception 1100000000
Looking at my taskmanager i saw hughe memory consumption VM size of 2 GB
physical memory of 980 MB
verry interesting as this proves to me that the maxsize of a string is
limited by
a : hardware
b : platform
C : max size of the integer data type
it is for sure that you can not ever create a string that is bigger as the
integer`s maximum size of the data type
however how the Hardware and platform relate to the maximum creatable size
is unknown to me , ,,,,,,,,,, interesting
regards
Michel Posseth
"Qwert" wrote:
Great, thanks both.
I tried to create a string with 2.147.483.647 characters, but around
50.000.000 characters my system can't handle it anymore. That's only 2% of
it...
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:eD**************@TK2MSFTNGP12.phx.gbl... "Qwert" <no**@nosp.com> schrieb: is there a max length for a System.String?
I guess it is ~ 'Int32.MaxValue', because otherwise properties and methods
of the 'String' class would not work as expected any more.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>