2GB virtual memory for each process?

G

Gregor Wind

Hello all,

for my image processing application I need a large amount of virtual memory.
I read, that it is normaly possible to get 2GB of virtual memory for each
process and when you modify the boot.ini file it should be possible to get
3GB vitual memory for one process.
I have tried to allocate nearly 2GB in my application, but I receive the
SystemOutOfMemory Exception. It is only possible to allocate a little bit
more than 1GB. I found out, that there is a property for each process,
MaxWorkingSet and MinWorkingSet, where I can choose the max and min working
set size that is allowed for the process in memory. I have increased the max
size to 2GB, but it is still not possible to get more virtual memory for my
application.
How can I use the full virtual memory of 2GB in my application(3GB)?
Are there other possibilities to increase the virtual memory size in .net,
C#?

Thanks in advance for your informations,

kind regards

Gregor
 
F

Frans Bouma [C# MVP]

Gregor said:
Hello all,

for my image processing application I need a large amount of virtual memory.
I read, that it is normaly possible to get 2GB of virtual memory for each
process and when you modify the boot.ini file it should be possible to get
3GB vitual memory for one process.
I have tried to allocate nearly 2GB in my application, but I receive the
SystemOutOfMemory Exception. It is only possible to allocate a little bit
more than 1GB. I found out, that there is a property for each process,
MaxWorkingSet and MinWorkingSet, where I can choose the max and min working
set size that is allowed for the process in memory. I have increased the max
size to 2GB, but it is still not possible to get more virtual memory for my
application.
How can I use the full virtual memory of 2GB in my application(3GB)?
Are there other possibilities to increase the virtual memory size in .net,
C#?

By allocating 2GB of memory, you ask windows to create a single continous
block of memory of 2GB, which might not be available. Does your machine have
3GB of memory or did you create a huge swap file to create the virtual memory
space? If not, that's the problem.

I'm not sure what kind of image processing you're going to do, but 2GB for
image processing seems rather big.

Frans.
 
N

Niki Estner

First of all: what platform are you running on? 3GB used to be only
available for server OS's...
Next: This is about 2GB/3GB address space. That is, if the first allocation
happens to be in the middle of those 2 GB, the biggest available block
afterwards will be 1 GB.
Also, some libraries reserve big amounts of continuos address space without
committing it. I could imagine the .NET runtime does something like that for
the various object heaps. I think it was possible to find out about things
like these with the command line debugger, but I don't really remember
how...
I don't think you have too many options to solve this, the best would
proably be to reduce memory usage of your app. The next best one could be a
64-bit processor, but I'm not sure what framework versions (1.0/1.1/2.0)
support it. And then there are AWE, an API that allows 32-bit windows
application to access more than 4 GB of memory. But they require a server
OS, and are directly not supported by the .net runtime. Maybe a hardware
solution (like an SRAM-based HD) could help you, too.
BTW: What kinds of images are this? A 1GB image could be about 30000x30000
pixels big, so I guess it could be a long video sequence. Couldn't it be
sufficient to have only a few frames in memory at a time?

Niki
 
T

TT \(Tom Tempelaere\)

Niki Estner said:
First of all: what platform are you running on? 3GB used to be only
available for server OS's...
Next: This is about 2GB/3GB address space. That is, if the first allocation
happens to be in the middle of those 2 GB, the biggest available block
afterwards will be 1 GB.
Also, some libraries reserve big amounts of continuos address space without
committing it. I could imagine the .NET runtime does something like that for
the various object heaps. I think it was possible to find out about things
like these with the command line debugger, but I don't really remember
how...
I don't think you have too many options to solve this, the best would
proably be to reduce memory usage of your app. The next best one could be a
64-bit processor, but I'm not sure what framework versions (1.0/1.1/2.0)
support it. And then there are AWE, an API that allows 32-bit windows
application to access more than 4 GB of memory. But they require a server
OS, and are directly not supported by the .net runtime. Maybe a hardware
solution (like an SRAM-based HD) could help you, too.
BTW: What kinds of images are this? A 1GB image could be about 30000x30000
pixels big, so I guess it could be a long video sequence. Couldn't it be
sufficient to have only a few frames in memory at a time?

Niki

Very high quality and large picture, in say 8 colors instead of the usual 4
(CMYK). For instance with gold + silver plus a few others for special
effects. For instance a high quality picture of 24 feet by 36 feet (a
picture for an advertising plate)?

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top