Re: Memory Limit



On Wed, 22 Aug 2007 01:26:01 -0700, mustafa <mustafa@xxxxxxxxxxxxxxxx>
wrote:

To be more precise,
1) What is the maximum size of the array that I can create?
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?

Since Windows uses a virtual memory model, the real issues affecting
performance (speed) are locality of references, size of cache
(determines frequency of cache hits), amount of real memory available
to the program (determines frequency of paging), what other processes
are running (determines how much CPU your program gets), and a whole
bunch of other stuff you have no control over. If stack vs heap has
any affect, it is insignificant compared to the other issues.

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.

Not to mention other processes running (firewall, virus checker, task
scheduler, clock interrupt handler, etc).

4) Do I need to use PhysicalMemory defragmentation? If yes what kind of tool
I can use for this purpose?

In a virtual memory system, physical memory is so dynamic that even if
you could defragment it, it would become fragmented again almost
immediately.

5) Why increasing the virtual memory ( = page file ?) to 10-20 GB doesnt
help to create bigger arrays?

Are there compiler or OS constraints on how much memory your program
will be allowed to consume?

6) Having 10GB virtual memory means that I can create 10GB size array?

See 5 above.



Remove del for email
.



Relevant Pages

  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (comp.lang.cpp)
  • Re: Error Raising and Memory in VB (general question)
    ... > object is terminated go out of scope, and the memory is also released. ... But why are you saying it uses stack? ... I think we are dealing with heap memory here. ... "COM's IMalloc allocator: ...
    (microsoft.public.vb.general.discussion)
  • Re: Linked List & Dynamic Memory Allocation
    ... Both of you mentioned stack and heap in this ... when I call malloc it uses heap to allocate memory. ... if you have an integer pointer object that lives beyond this scope and you had: ...
    (microsoft.public.vc.mfc)
  • Re: hacker challenge - traverse a list
    ... He means that you can use as much additional memory as you like, ... any Osolution can use a stack of arbitrary bounds by mapping ... even misused computational complexity theory does not ... Harter's test by pointing out that a program with a large array ...
    (comp.programming)

Loading