Allocating big data

I need to read a big file with 12 different items type and then show it as tree with 12 levels. I have used 5 classes, let say class1-5 and each class has a list of next class. for example:
class1 { CTypedPtrList<CPtrlist, *class2> m_list;} and class2{ CTypedPtrList<CPtrlist, *class3> m_list;} and so on

i have done it with creating classes (with new)and put them in the corresponding list and then put data in the treeCtrl. I remove all instances of classess in the OnDestroy(). So far everything works fine, but i when i get a very big file so i must allocate a lot in the heap(12 level while state and new classx in evert while state)
I Wonder if there is any safe or better method to store so much data? :confused:
[750 byte] By [hammid] at [2007-11-19 7:29:40]
# 1 Re: Allocating big data
I need to read a big file with 12 different items type and then show it as tree with 12 levels. I have used 5 classes, let say class1-5 and each class has a list of next class. for example:
class1 { CTypedPtrList<CPtrlist, *class2> m_list;} and class2{ CTypedPtrList<CPtrlist, *class3> m_list;} and so on

i have done it with creating classes (with new)and put them in the corresponding list and then put data in the treeCtrl. I remove all instances of classess in the OnDestroy(). So far everything works fine, but i when i get a very big file so i must allocate a lot in the heap(12 level while state and new classx in evert while state)
I Wonder if there is any safe or better method to store so much data? :confused:
Allocating on the heap is a good thing that you are doing.

You must check your program for leaks using a utlity like BoundsChecker. If you free/delete all that you allocate - you are on safe grounds. ;)

If your program does not leak, then you can theoretically handle very big files/data - without problems.

Remember that in event of large memory usage, the constraint is the Virtual Memory available to the system, and it should be a part of your Minimum Operating Specifications.
Siddhartha at 2007-11-11 0:27:20 >
# 2 Re: Allocating big data
I have noticed that i must change optimization for C++ in project setting from maximize to default for Relaease mode, otherwise it can not allocate all classess and put it in the treeview. Is it correct way or it means that i do something wrong?
:confused:
hammid at 2007-11-11 0:28:22 >
# 3 Re: Allocating big data
I have noticed that i must change optimization for C++ in project setting from maximize to default for Relaease mode, otherwise it can not allocate all classess and put it in the treeview. Is it correct way or it means that i do something wrong?
:confused:
Well...what do you mean with "it can not allocate all classes"? Does it fail? Does it crash? Does it throw an exception?

Furthermore...how ig are the data? How many bytes, kilobytes, megabytes?
Andreas Masur at 2007-11-11 0:29:20 >
# 4 Re: Allocating big data
Sorry, i mean maximize speed in the project setting under C++ lobe.
hammid at 2007-11-11 0:30:19 >
# 5 Re: Allocating big data
Sorry, i mean maximize speed in the project setting under C++ lobe.
Well...that still doesn't answer my questions... ;)
Andreas Masur at 2007-11-11 0:31:28 >
# 6 Re: Allocating big data
The file can be from 50K up to 1M byte, but i have more info(about 100 bytes) to save for say every 10 bytes in file. Each class in average has about 110 bytes size and i have 5 top level item (item-lev1), each has 125 item-lev2, each item-lev2 has 25 item-lev3 and the rest down to level 12 has 8 item each. So the total size of data can be up to 1-30M which im saving on the heap.
hammid at 2007-11-11 0:32:28 >
# 7 Re: Allocating big data
The file can be from 50K up to 1M byte, but i have more info(about 100 bytes) to save for say every 10 bytes in file. Each class in average has about 110 bytes size and i have 5 top level item (item-lev1), each has 125 item-lev2, each item-lev2 has 25 item-lev3 and the rest down to level 12 has 8 item each. So the total size of data can be up to 1-30M which im saving on the heap.
And what does not work in release mode? What happens?
Andreas Masur at 2007-11-11 0:33:22 >
# 8 Re: Allocating big data
"Out of memory" message i got , sometimes the program exited without any meaasges.
hammid at 2007-11-11 0:34:28 >