S
Stuart
I have a small class of data values made up of ints and bools
totalling 25 bytes. Each of these 25 byte nodes is stored in another
class as an ArrayList with a few more ints. Typically there are around
400 nodes stored in each of these segment classes. - which makes each
segment occupy around 10KB.
I use further ArrayList to store around 30,000 of these segments,
which are read in from a file.
If a read in a file that contains 10,000 of these segments with the
node data, everything *seems* OK. Try reading 15,000 and the program
gets very slow at populating the ArrayList. Try the full 30,000, and
the program just goes on for ever trying to load the data in off the
disk, eventually warning me of low virtual memory.
The PC I'm developing on has 256MB of RAM. It looks to me as if too
much data is being stored to the stack instead of the heap, which I
would have thought would have been more than capable of storing 300MB
of segment data.
All I'm doing is creating instances of the classes, as the data is
read from the disk, then Adding them to the ArrayLists.
1) Does anyone have any advice as to if the ArrayList should be able
to handle this amount of data?
2) Are there any little gotchyas to watch out for when working with
large ArrayLists in c#?
Many thanks
Stuart
totalling 25 bytes. Each of these 25 byte nodes is stored in another
class as an ArrayList with a few more ints. Typically there are around
400 nodes stored in each of these segment classes. - which makes each
segment occupy around 10KB.
I use further ArrayList to store around 30,000 of these segments,
which are read in from a file.
If a read in a file that contains 10,000 of these segments with the
node data, everything *seems* OK. Try reading 15,000 and the program
gets very slow at populating the ArrayList. Try the full 30,000, and
the program just goes on for ever trying to load the data in off the
disk, eventually warning me of low virtual memory.
The PC I'm developing on has 256MB of RAM. It looks to me as if too
much data is being stored to the stack instead of the heap, which I
would have thought would have been more than capable of storing 300MB
of segment data.
All I'm doing is creating instances of the classes, as the data is
read from the disk, then Adding them to the ArrayLists.
1) Does anyone have any advice as to if the ArrayList should be able
to handle this amount of data?
2) Are there any little gotchyas to watch out for when working with
large ArrayLists in c#?
Many thanks
Stuart