Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
In my application i am using very big lists of points i.e.
C#
List<point> Lst=new List<point>(1008000);

I am creating 25 such big lists. But unfortunately CLR throws out of memory exception.
Please let me know how i can handle this issue.
[edit]Code block added - OriginalGriff[/edit]

What I have tried:

I already googled and found that compiling as x64 solves the issue, but i do not want to change application to x64. Is there any other way to handle memory out of range issue.
Posted
Updated 9-Aug-16 19:34pm
v2
Comments
Kenneth Haugland 9-Aug-16 15:18pm    
Split your list up in smaller lists, or create your own that does this for you.
ZurdoDev 9-Aug-16 16:23pm    
Add memory. Optimize code. Change what you are doing. What other options might there be?
njammy 9-Aug-16 16:29pm    
Consider distributed processing via multiple services/transactions and keep track using a more efficient model.
Ramza360 9-Aug-16 16:54pm    
Try virtualization with a data source.
Beginner Luck 9-Aug-16 21:17pm    
x32 bit and x64 bit of understands int is different. example int is in x32 is int32 and in x64bit is int64. if you use database you know the limit contain is different as int x64 more than int x32bit
http://stackoverflow.com/questions/5812406/16-bit-int-vs-32-bit-int-vs-64-bit-int

1 solution

On x86 machines (32bit) the memory is limited to 4gb total of which the OS takes 1gb which leaves theoretically 3gb for apps but practically you are limited to 1.8gb-2.5gb depending on your hardware.

If should strongly rethink keeping a lot of data in memory unless there is a very good reason for it, blocking/chunking data is much more efficient in most cases and you will not be limited by your hardware.

Look at Key/Value data stores, or even relational databases which were designed for handling data.
 
Share this answer
 
Comments
CPallini 10-Aug-16 2:33am    
My 5.
Mehdi Gholam 10-Aug-16 2:35am    
Cheers man!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900