Re: Memory Limit for Visual Studio 2005???
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Fri, 22 Dec 2006 22:57:59 +0100
"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message news:npYih.81$0D2.74@xxxxxxxxxxxxxxx
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message news:e1dBZ2gJHHA.4960@xxxxxxxxxxxxxxxxxxxxxxx"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message news:kpXih.158246$HO4.89389@xxxxxxxxxxxxxxx
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message news:eOOSzggJHHA.4244@xxxxxxxxxxxxxxxxxxxxxxx"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message news:RHVih.128727$xM4.15597@xxxxxxxxxxxxxxx
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message news:%23mAxnRfJHHA.3872@xxxxxxxxxxxxxxxxxxxxxxx"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message news:HPUih.128718$xM4.75416@xxxxxxxxxxxxxxx
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message news:%23yLni8eJHHA.5104@xxxxxxxxxxxxxxxxxxxxxxx"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message news:RKQih.33440$B42.17767@xxxxxxxxxxxxxxxIt looks like System::Collections::Generic.List throws and OUT_OF_MEMORY exception whenever memory allocated exceeds 256 MB. I have 1024 MB on my system so I am not even out of physical RAM, much less virtual memory.
Are other people experiencing this same problem?
Why do you mention VS2005? This is thrown at program run-time, right? The run-time limitation is 2GB for a CLR object type, that means that your List can only hold at most 2GB, however, due heap fragmentation of a 32 bit process, the maximum size of a single object is limited to something from 1.2GB up to 1.8GB depending on the type of OS and application. A simple console application should be able to allocate a single List of ~1.6GB or more , Windows Forms will top at ~1.2GB for the largest List (or array or whatever).
Willy.
If you have actually tested this and thus know that it works empirically rather than theoretically, then this must be a limitation of Visual Studio 2005 Express. I could not get Visual Studio 2005 Express to allocate more than 256 MB without abnormally terminating.
I was very pleased with its relative performance to Native Code Visual C++ 6.0. It was something like 50% faster on every test.
No, once again this is run-time related VS does (and can't impose such restrictions) , try to compile and run your code from the command-line prompt if you do't trust me.
Keep in mind that when you don't pre-allocate the List, you will end with a List doubling it's size each time it get's filled to the max. capacity, so the OOM exception might get thrown when no free *contiguous* block of ~512MB can be found in excess of the already allocated ~256MB.
Willy.
Willy.
It works fine for native code std::vector, yet does not work for either managed std::vector or List<Byte> . The command line version failed to compile.
There is no such thing like MANAGED std::vector,
Yes, there is just recently. This saves old C++ programmers like me alot of learning curve switching to .NET.
No, there is not, the managed "std" like templates are currently in a "closed" pre-beta stage and are scheduled for public release after the ORCAS release (another wait for at least one year), and will not belong to the std namespace, that is they will not be named std::vector.
Willy.
http://blogs.msdn.com/vcblog/archive/2006/09/30/777835.aspx
It looks like you were right, yet I then wonder why the std::vector compiled? Did it mix native code and managed code together in the same function? (I had a std::vector, and a Generic.List in the same function).
Yes, this is because you compiled with the clr option, this means mixed mode! the std::vector template will compile as a native class .Try to compile in pure managed mode /clr:safe and it will fail.
Willy.
.
- References:
- Memory Limit for Visual Studio 2005???
- From: Peter Olcott
- Re: Memory Limit for Visual Studio 2005???
- From: Willy Denoyette [MVP]
- Re: Memory Limit for Visual Studio 2005???
- From: Peter Olcott
- Re: Memory Limit for Visual Studio 2005???
- From: Willy Denoyette [MVP]
- Re: Memory Limit for Visual Studio 2005???
- From: Peter Olcott
- Re: Memory Limit for Visual Studio 2005???
- From: Willy Denoyette [MVP]
- Re: Memory Limit for Visual Studio 2005???
- From: Peter Olcott
- Re: Memory Limit for Visual Studio 2005???
- From: Willy Denoyette [MVP]
- Re: Memory Limit for Visual Studio 2005???
- From: Peter Olcott
- Memory Limit for Visual Studio 2005???
- Prev by Date: Re: Memory Limit for Visual Studio 2005???
- Next by Date: Re: Memory Limit for Visual Studio 2005???
- Previous by thread: Re: Memory Limit for Visual Studio 2005???
- Next by thread: Re: Memory Limit for Visual Studio 2005???
- Index(es):
Relevant Pages
|