472,353 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

is there some per-process-limit on memory in .net processes? is there any way to increase it? i keep getting System.OutOfMemoryException when my box has 8 gigs of unused memory.

is there some per-process-limit on memory in .net processes? is there any
way to increase it? i keep getting System.OutOfMemoryException when my box
has 8 gigs of unused memory.
Sep 15 '07 #1
4 5654
"Daniel" <so*******************@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
is there some per-process-limit on memory in .net processes? is there any
way to increase it? i keep getting System.OutOfMemoryException when my box
has 8 gigs of unused memory.

A 32 bit process can only address 2 GB. Doesn't matter how much memory you
have on your system, the limit is the process. . That being said, you
probably will only see a max 1.6 GB max allocation (32 bit) due to other
factors... and due to memory fragmentation you'll probably not be able to
allocate a block larger than what, 1GB or so?

If you want to be able to get over that limitation, you'll need to run it on
a 64 bit processor in a 64 bit process. 32 bit processes even on a 64 bit
machine still suffer the ame limitation since the process still sees
everyting '32 bits'.

--
Doug Semler, MCPD
a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh).
The answer is 42; DNRC o-
Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira
erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?

Sep 15 '07 #2
"Doug Semler" <do********@gmail.comwrote in message
news:eF*************@TK2MSFTNGP05.phx.gbl...
"Daniel" <so*******************@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>is there some per-process-limit on memory in .net processes? is there any
way to increase it? i keep getting System.OutOfMemoryException when my
box has 8 gigs of unused memory.


A 32 bit process can only address 2 GB. Doesn't matter how much memory
you have on your system, the limit is the process. . That being said, you
probably will only see a max 1.6 GB max allocation (32 bit) due to other
factors... and due to memory fragmentation you'll probably not be able to
allocate a block larger than what, 1GB or so?

If you want to be able to get over that limitation, you'll need to run it
on a 64 bit processor in a 64 bit process. 32 bit processes even on a 64
bit machine still suffer the ame limitation since the process still sees
everyting '32 bits'.
Not really, on 64 bit Windows the "system portion" is no longer mapped into
the process virtual address space, that means that a 32 bit process enjoys a
full 2^32 (4GB) users address space. To take advantage of this you'll have
to set the LARGEADDRESSAWARE bit in the X86 PE header file. For C# and
VB.NET this means compiling with /platform:x86 and run editbin
/LARGEADDRESSAWARE on the executable file
For C++ and C++/CLI you'll have to specify the /MACHINE:X86 and
/LARGEADDRESSAWARE linker options.
X64 and MSIL code runs in a 64 bit process so these application have access
to ~8TB of VM.
Note that, despite the larger users address space available to 32 bit
processes on 64 bit Windows, that the largest CLR object is still limited to
~2GB, allocating larger objects will throw OOM's even when running MSIL or
X64 code on 64bit Windows. Also, be aware that even with 4GB available for
32 bit code, you'll still can get OOM exceptions thrown on you, long before
you even reach this limit, this as a result of process heap fragmentation.

Willy.
Sep 15 '07 #3
"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
"Doug Semler" <do********@gmail.comwrote in message
news:eF*************@TK2MSFTNGP05.phx.gbl...
>"Daniel" <so*******************@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>>is there some per-process-limit on memory in .net processes? is there
any way to increase it? i keep getting System.OutOfMemoryException when
my box has 8 gigs of unused memory.


A 32 bit process can only address 2 GB. Doesn't matter how much memory
you have on your system, the limit is the process. . That being said,
you probably will only see a max 1.6 GB max allocation (32 bit) due to
other factors... and due to memory fragmentation you'll probably not be
able to allocate a block larger than what, 1GB or so?

If you want to be able to get over that limitation, you'll need to run it
on a 64 bit processor in a 64 bit process. 32 bit processes even on a
64 bit machine still suffer the ame limitation since the process still
sees everyting '32 bits'.
Doug must learn to proofread. <gI *meant* to say 32 bit processes still
suffer a similar limitation on x64. (but it's 4 gb not 2)
>
Not really, on 64 bit Windows the "system portion" is no longer mapped
into the process virtual address space, that means that a 32 bit process
enjoys a full 2^32 (4GB) users address space. To take advantage of this
you'll have to set the LARGEADDRESSAWARE bit in the X86 PE header file.
For C# and VB.NET this means compiling with /platform:x86 and run editbin
/LARGEADDRESSAWARE on the executable file
Sure. And on some versions of the 32 bit windows, you can also give 3GB
virtual address space if you boot with /3GB when the LARGEADDRESSAWARE bit
is set in the executable. But to me that can be just a "trick" and
depending on the application may or may not be the appropriate thing to do.
For a high transaction volume server apps (exchange, msmq, sql, etc), sure,
being able to address that extra gig or 2 increases app performance. But if
the problem is because you're trying to read an mpeg file thats 5 GB long
into memory all at once, well, that's a different story and should be
addressed at the design level...
Note that, despite the larger users address space available to 32 bit
processes on 64 bit Windows, that the largest CLR object is still limited
to ~2GB, allocating larger objects will throw OOM's even when running MSIL
or X64 code on 64bit Windows.
However I've always wondered the purpose of the Array.LongLength property
with respect to that limitation <g>

--
Doug Semler, MCPD
a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh).
The answer is 42; DNRC o-
Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira
erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?

Sep 15 '07 #4
"Doug Semler" <do********@gmail.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>"Doug Semler" <do********@gmail.comwrote in message
news:eF*************@TK2MSFTNGP05.phx.gbl...
>>"Daniel" <so*******************@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl.. .
is there some per-process-limit on memory in .net processes? is there
any way to increase it? i keep getting System.OutOfMemoryException when
my box has 8 gigs of unused memory.
A 32 bit process can only address 2 GB. Doesn't matter how much memory
you have on your system, the limit is the process. . That being said,
you probably will only see a max 1.6 GB max allocation (32 bit) due to
other factors... and due to memory fragmentation you'll probably not be
able to allocate a block larger than what, 1GB or so?

If you want to be able to get over that limitation, you'll need to run
it on a 64 bit processor in a 64 bit process. 32 bit processes even on
a 64 bit machine still suffer the ame limitation since the process still
sees everyting '32 bits'.

Doug must learn to proofread. <gI *meant* to say 32 bit processes still
suffer a similar limitation on x64. (but it's 4 gb not 2)
>>
Not really, on 64 bit Windows the "system portion" is no longer mapped
into the process virtual address space, that means that a 32 bit process
enjoys a full 2^32 (4GB) users address space. To take advantage of this
you'll have to set the LARGEADDRESSAWARE bit in the X86 PE header file.
For C# and VB.NET this means compiling with /platform:x86 and run editbin
/LARGEADDRESSAWARE on the executable file

Sure. And on some versions of the 32 bit windows, you can also give 3GB
virtual address space if you boot with /3GB when the LARGEADDRESSAWARE bit
is set in the executable. But to me that can be just a "trick" and
depending on the application may or may not be the appropriate thing to
do. For a high transaction volume server apps (exchange, msmq, sql, etc),
sure, being able to address that extra gig or 2 increases app performance.
But if the problem is because you're trying to read an mpeg file thats 5
GB long into memory all at once, well, that's a different story and should
be addressed at the design level...
>Note that, despite the larger users address space available to 32 bit
processes on 64 bit Windows, that the largest CLR object is still limited
to ~2GB, allocating larger objects will throw OOM's even when running
MSIL or X64 code on 64bit Windows.

However I've always wondered the purpose of the Array.LongLength property
with respect to that limitation <g>
In the current implementation, this property is nothing else than a type
cast of an int (Array.Length) to a long. Maybe we will ever see an
implementation that returns what it should, that is - the *sum* of the
Length of all elements
Note that the 2GB restriction is imposed by the CLR on all objects allocated
on the GC heap, not only on Array types.
The Array's Length property (an Int32) denotes the number of elements in the
array, without the CLR restriction, an Array could theoretically hold 16GB
if the element was a long.

Willy.
Sep 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: _andrea.l | last post by:
Vorrei far scaricare i file agli utenti ma, per motivi di sicurezza, vorrei nascondere il loro url: per fare questo avrei pensato di scrivere...
6
by: btopenworld | last post by:
I have an access database with lots of fields including a memo field called 'priecinfo'. Everything works well, lots of data is written, but in...
2
by: RogBaker | last post by:
I have a report in MS Access 2000. In the Detail section of the Report, I have the following record information. TextBox:Name TextBox:Address1...
7
by: Rob Nicholson | last post by:
We're using a well known presentation layer library to implement complex controls on an intranet site. IE has the following limitation which...
2
by: needin4mation | last post by:
Hi, I have to decide between a per device and a per license issue. We have several web services that have functions that use things like...
2
by: Viken Karaguesian | last post by:
Hello all, I don't mean to exclude the rest of the world here, but I think this will be more applicable for me. What's the going rate for...
8
by: KMZ_state | last post by:
We have a question here where a developer says that if the same user starts 2 instances of the application on his machine, the session variables may...
9
by: bakxchaixDD | last post by:
I DON'T GET THIS project: Many treadmills output the speed in miles per hour. However, most runners think of their pace in minutes and seconds...
0
by: Strasser | last post by:
How much did a collection of items cost at some date in the past? If anyone could help me with this, I would be most appreciative. I am learning...
0
by: raveekumarg | last post by:
hi what is the difference between per seat , per server , per processor and i am new to sql 2000 , pl do explain the same.
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.