473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Memory issue, process termineted

Hi,
I have a c# console exe
Based on input it consumes arround 1-3 gb of memory
I am trying to run it on win2003 box with 8GB of ram.

Once the consumed memory goes beyound 1 GM the process get termonated.
Am not sure if it is terminated by OS or by something security
settings of .Net.

Can anybody suggest what could be the reason.

Thanks in advance.
Dev

Nov 1 '07 #1
7 1054
Well, there is a 2GB limit on the size of a process in Win32. You can
up this slightly using the /3GB switch
http://blogs.msdn.com/oldnewthing/ar...13/214117.aspx

However, another big issue is what you memory looks like inside the
process - i.e. are you trying to allocate huge arrays? If so,
fragmentation will be a major issue, that could trigger an
OutOfMemoryException, presumably crashing your app.

Another consideration is: are you using your memory effectively? Hard
to tell without a /lot/ of info, though.

You could switch to Win64, but note that this changes the equation;
each reference has a larger footprint. If you have a huge array of
structs this is probably fine. If you have a huge array of objects (or
just a lot of references generally) your memory consumption will jump
yet further. But the process will have more space, so it is a double-
edged sword.

Marc

Nov 1 '07 #2
Oh, and you'd need to tweak the exe; Willy explains it here:

http://www.thescripts.com/forum/thread275030.html

Nov 1 '07 #3
Another discussion, again with Willy Denoyette at the helm:
http://www.thescripts.com/forum/thread586209.html

Nov 1 '07 #4
<pr***********@gmail.comwrote in message
news:11**********************@t8g2000prg.googlegro ups.com...
Hi,
I have a c# console exe
Based on input it consumes arround 1-3 gb of memory
I am trying to run it on win2003 box with 8GB of ram.

Once the consumed memory goes beyound 1 GM the process get termonated.
Am not sure if it is terminated by OS or by something security
settings of .Net.

Can anybody suggest what could be the reason.

Thanks in advance.
Dev

Seems like you are running on W2K3 32 bit, that means that the maximum
amount of memory available to a process is ~2GB. The largest contiguous area
of free memory in such process space is ~1.5GB, so whenever you try to
allocate an array of that size you are at risk to get an out-of-memory
exception thrown on you.
The question is why do you allocate that much memory, in the first place?

Willy.
Nov 1 '07 #5
For the OP's benefit - note also that the CLR places a 2GB limit on a
single object, which again limits the size of (for example) huge
arrays. And for an array of object-references (not structs) note that
of course the maximum number of items will shrink as the size of each
reference goes up (using 64bit over 32bit). But in most cases these
limits [process and object] are purely academic - it is quite rare for
an app to need more than this.

Marc

Nov 1 '07 #6
"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@v3g2000hsg.googlegro ups.com...
For the OP's benefit - note also that the CLR places a 2GB limit on a
single object, which again limits the size of (for example) huge
arrays. And for an array of object-references (not structs) note that
of course the maximum number of items will shrink as the size of each
reference goes up (using 64bit over 32bit). But in most cases these
limits [process and object] are purely academic - it is quite rare for
an app to need more than this.

Marc

Absolutely, note that the object size limit is also applicable on 64-bit
Windows, and even with the extremely large VAS on 64-bit, one can run into
OOM exceptions. You can never allocate more memory than the available free
virtual memory space (free RAM space + free pagefile space).

Willy.

Nov 1 '07 #7
Hi,
What are you trying to do?

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
<pr***********@gmail.comwrote in message
news:11**********************@t8g2000prg.googlegro ups.com...
Hi,
I have a c# console exe
Based on input it consumes arround 1-3 gb of memory
I am trying to run it on win2003 box with 8GB of ram.

Once the consumed memory goes beyound 1 GM the process get termonated.
Am not sure if it is terminated by OS or by something security
settings of .Net.

Can anybody suggest what could be the reason.

Thanks in advance.
Dev

Nov 1 '07 #8

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

Similar topics

9
by: Mike P | last post by:
I know everything about reference counting and making sure you don't have large objects lying around. I have also profiled my app with multiple tools. I know about the fact GC collects memory but...
25
by: Zeng | last post by:
I finally narrowed down my code to this situation, quite a few (not all) of my CMyClass objects got hold up after each run of this function via the simple webpage that shows NumberEd editbox. My...
6
by: Stan | last post by:
There was a number of postings about aspnet_wp worker process taking too much memory and eventually choking the webserver. One issue is still not clear to me - how can I narrow it down to an...
8
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
2
by: a_agaga | last post by:
Do you know are there some reasons why many do not make processes to communicate through memory? Why network connections (sockets) are used so commonly in IPC (inter process communication)...
2
by: ruca | last post by:
Hi gurus, Can anyone tell me please when I really must setup the value of memory that aspnet_wp or w3wp must use in IIS server machine? What I mean is that we have clients that have diferent...
3
by: san | last post by:
we cannot stop the application from increasingly use memory. The CRM Worker process will continually consume memory but not release it back to the system. Please research into how to make the...
2
by: =?Utf-8?B?SXJmYW4=?= | last post by:
Hello, It may be a repeated question but I don't find the solution to the situation that I encounter in it. My application is monitoring another application that is built in VB6. The...
6
by: itsolution | last post by:
Hi folks, Could you shed some light on this issue? my program is running on Freebsd as a daemon. When user sends a request, it forks itself and lets its child process handles the request....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.