Archived

This topic is now archived and is closed to further replies.

Tinmizer

Variables - VS - Memory limits.

Recommended Posts

Tinmizer    122
If I was to make an array 1024*1024*1024 and each variable was to store a number anywhere from -9999 to +9999 how many variables could I have before my system would lock up. I have 512 MB of RAM and 64MB of Video memory. Im looking to find the dimensions of an array that I could comfortably use while running other variables through the system at the same time without locking it up. Edited by - Tinmizer on December 18, 2001 7:14:10 AM

Share this post


Link to post
Share on other sites
Kylotan    10008
Firstly, the system should never lock up under those circumstances. If it does, your OS is very bad

Anyway... video memory is (almost certainly) irrelevant for this discussion. A variable large enough to hold -9999 to +9999 is a short int, which is 2 bytes. So your array size you mentioned would be 2GB in size. It would probably just crash with a ''stack overflow'' error, a bad_alloc exception, or a NULL pointer from new or malloc, depending on how you allocated it.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

Share this post


Link to post
Share on other sites
Tinmizer    122
NOTE: The 10% is only hypothetical.

So to get an array of this size to work I would have to fill about 10% of the array then save it to disk then fill another 10% and then to disk again until I had the full array filled. An when I wanted to use this info for something I would only be able to access 10% of it at a time because the system couldnt handle it all.
In other words I would be using the harddrive instead of ram because it can hold more info, but is slower.

Share this post


Link to post
Share on other sites
Hairybudda    116
quote:
Original post by Tinmizer
NOTE: The 10% is only hypothetical.

So to get an array of this size to work I would have to fill about 10% of the array then save it to disk then fill another 10% and then to disk again until I had the full array filled. An when I wanted to use this info for something I would only be able to access 10% of it at a time because the system couldnt handle it all.
In other words I would be using the harddrive instead of ram because it can hold more info, but is slower.


Hence the name, virtual memory, thats what your paging file does...

*stoned*

Share this post


Link to post
Share on other sites
a person    118
the reason your pc seems to lock up is because the os is getting the virtual memory form disk prepped. which takes awhile for 2gig on a harddrive (no matter how fast).

unfortunatly for you though, most ppl will not use an app that requires a 2gig+ file. so you just have to find another way. and this excludes making your own swap file.

why do you need such a large array? what are you trying to do?

Edited by - a person on December 18, 2001 2:54:10 PM

Share this post


Link to post
Share on other sites