Posted by webmaster Guido on February 11, 2007
In Reply to How big can a TStringList be? posted by Diane
Channers P15844 on
February 08, 2007
How many strings can I put in a TStringList object? Is this limited, such as for example the ListBox?
In Delphi there is no limit for a StringList, not for the amount of string-items nor for the length of each string.
But Windows will complain about "out of resources" at a certain point. Testing showed us that the maximum number of items is a bit over 60 million with Delphi 2006 on a Windows XP system. The length of each stringlist item seems to have no influence on this maximum, we tested even with strings of 10 million characters (!) and we were able to stuff several gigabytes into a stringlist.
Earlier, on a Win98 system, we found that Windows gave an error when items * itemlength was a bit over 16 MB, so that's about 16 million items of 1 character each, or 1 million items of 16 characters, or...