473,394 Members | 1,658 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,394 software developers and data experts.

Memory management in Debug/Release environments

Hello,

I have a problem where an application I am working on throws an
OutOfMemoryException when I run it in Release mode, whereas it doesn't do
this when I am running in Debug.

The application is developed using C++/Managed C++ and built using VS 2003
under .NET framework 1.1.

In Debug, it uses of up to 600Mb of memory, whereas in Release it only gets
to use about 200Mb before throwing the Exception.

I've attempted to debug the Release version (by building it so that it
outputs symbols and attaching), and it appears that the application throws
the exception when it attempts to instantiate a .NET class using new. (The
managed C++ code calls a function from a library written in C# which then
attempts to do the instantiation.)

Is there any reason why the application should behave differently
Debug/Release environment with respect to memory management? Is there
setting I can change to get the Release version to use more memory before it
complains of an out-of-memory error?

If there's any further information you need me to supply, I'd be happy to do
so.

Thanks in advance,

--
Akin

(aknak at aksoto dot idps dot co dot uk)
Oct 5 '06 #1
2 2352
I've had experience with programs which would run fine on a Debug
version, but would crash in a Release version.

I noticed that there is something different about the way local
variables are initialized in the debug and release versions (or the
return value of a function that does not return anything under certain
conditions). I found that the crashes happened because I used certain
variables without initializing them.

Hope this helps.
Vijay.

Epetruk wrote:
Hello,

I have a problem where an application I am working on throws an
OutOfMemoryException when I run it in Release mode, whereas it doesn't do
this when I am running in Debug.

The application is developed using C++/Managed C++ and built using VS 2003
under .NET framework 1.1.

In Debug, it uses of up to 600Mb of memory, whereas in Release it only gets
to use about 200Mb before throwing the Exception.

I've attempted to debug the Release version (by building it so that it
outputs symbols and attaching), and it appears that the application throws
the exception when it attempts to instantiate a .NET class using new. (The
managed C++ code calls a function from a library written in C# which then
attempts to do the instantiation.)

Is there any reason why the application should behave differently
Debug/Release environment with respect to memory management? Is there
setting I can change to get the Release version to use more memory before it
complains of an out-of-memory error?

If there's any further information you need me to supply, I'd be happy to do
so.

Thanks in advance,

--
Akin

(aknak at aksoto dot idps dot co dot uk)
Oct 6 '06 #2
Loy
Sound reasonable - release build optimize out initialization code -
esspecially in unmanaged code.

(While debug build usually even clear the memory of byte arrays when
they are allocated)

Vijay point - seem correct

Vijay wrote:
I've had experience with programs which would run fine on a Debug
version, but would crash in a Release version.

I noticed that there is something different about the way local
variables are initialized in the debug and release versions (or the
return value of a function that does not return anything under certain
conditions). I found that the crashes happened because I used certain
variables without initializing them.

Hope this helps.
Vijay.

Epetruk wrote:
Hello,

I have a problem where an application I am working on throws an
OutOfMemoryException when I run it in Release mode, whereas it doesn't do
this when I am running in Debug.

The application is developed using C++/Managed C++ and built using VS 2003
under .NET framework 1.1.

In Debug, it uses of up to 600Mb of memory, whereas in Release it only gets
to use about 200Mb before throwing the Exception.

I've attempted to debug the Release version (by building it so that it
outputs symbols and attaching), and it appears that the application throws
the exception when it attempts to instantiate a .NET class using new. (The
managed C++ code calls a function from a library written in C# which then
attempts to do the instantiation.)

Is there any reason why the application should behave differently
Debug/Release environment with respect to memory management? Is there
setting I can change to get the Release version to use more memory before it
complains of an out-of-memory error?

If there's any further information you need me to supply, I'd be happy to do
so.

Thanks in advance,

--
Akin

(aknak at aksoto dot idps dot co dot uk)
Oct 8 '06 #3

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

Similar topics

0
by: Stefan Seefeld | last post by:
hi there, I'm writing some C python extension and I'd like to debug the memory management, i.e. run some tests to see whether I did the ref counting correctly, etc. What's the suggested way...
2
by: DANIEL BEAULIEU J | last post by:
Basically i am a student taking an operating systems course which is c++ intensive. Familiar with Java, and so not so familiar with memory management. Looking for suggestions of exercises or web...
9
by: Rafael Charnovscki | last post by:
I can comprehend the basics of that subject (pointers, memory allocation, heap, stack etc), but I am interested to have references with more details. I have some C/C++ books and lots of URLs...
2
by: Scott Yost | last post by:
I reference a .NET DLL to import some of my custom types. I can build that DLL in debug or release mode, but I usually keep the debug one built so I can debug it. When I want to link to the release...
1
by: Rob Nicholson | last post by:
We're developing our first large scale ASP.NET web application and I'm a little concerned over memory usage of aspnet_wp.exe on the development server during testing. The application appears to use...
8
by: Chad | last post by:
hello, i am losing memory each time i make this call to a C++ dll (I make frequent calls). 'in VB.Net Declare Function grab Lib "grabber.dll" _ (ByRef lpBuf As Byte, ByVal lnum As Integer)...
4
by: cesar.ortiz | last post by:
Hi, I am starting to have a look to a python program that does not free memory (I am using python 2.4.3). As I have read about a new memory management in python 2.5...
6
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
7
by: Joey | last post by:
VS2005 asp.net 2.0 C# Developing with File System/Cassini instead of IIS (publish to IIS every so often) Hello guys, I have a web app where I am using static variables on many pages to...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.