Re: Memory Limit
- From: "Bo Persson" <bop@xxxxxx>
- Date: Wed, 22 Aug 2007 17:12:44 +0200
mustafa wrote:
:: To be more precise,
:: 1) What is the maximum size of the array that I can create?
It's not a hard limit. It depends on what else your program does.
:: 2) Is Heap or Stack based variable declaration just affects the
:: speed? I mean, is it possible to create the same maximum size
:: array with the stack, just sacrificing the speed?
When we are talking GB sizes, allocation speed isn't an issue because
you can only do one or two allocations. If you allocate hundreds of
millions of small objects, allocation speed will be visible.
It is unlikely that you can allocate GB sizes for the stack, so that's
really not an option.
:: 3) Having 2GB physical memory doesnt mean that you can use all
:: this space, because some part of this memory is already consumed
:: by Operating system by default.
You can use most of it, because most of the OS will swap out to disk
when needed. Your own program, and all supporting DLLs, will consume
parts of the virtual memory. Physical is of less importance.
:: 4) Do I need to use PhysicalMemory defragmentation? If yes what
:: kind of tool I can use for this purpose?
No. Your problem is with virtual memory. On a 32-bit system you just
run out of addresses when dealing with GBs.
:: 5) Why increasing the virtual memory ( = page file ?) to 10-20 GB
:: doesnt help to create bigger arrays?
Because you can only address 2 (or 3) GB per program. Having a larger
page file lets you have several programs each using 2-3 GB.
Check out how many bits you need to count to 3 billion. How many do we
have?
:: 6) Having 10GB virtual memory means that I can create 10GB size
:: array?
On a 64 bit system - yes. On a 32 bit system - no you can't have that
much virtual memory.
Bo Persson
.
- Follow-Ups:
- Re: Memory Limit
- From: mustafa
- Re: Memory Limit
- References:
- Re: Memory Limit
- From: Nathan Mates
- Re: Memory Limit
- From: mustafa
- Re: Memory Limit
- From: mustafa
- Re: Memory Limit
- Prev by Date: Re: undefined files in project dir
- Next by Date: Re: Memory Limit
- Previous by thread: Re: Memory Limit
- Next by thread: Re: Memory Limit
- Index(es):
Relevant Pages
|