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

With proxy architecture, unmanaged DLLs appear to be leaking committed memory...

My program structure is:

1. [web interface]

2. [my managed code DLLs: C#]

3. [my proxy layer DLL: managed C++ classes mapping to unmanaged C++
classes] => manually does the crt-init and crt-terminate calls

4. [my pure unmanaged DLL] -- this is accessed by the unmanaged C++
classes in (3) using LoadLibrary and FreeLibrary

5. [third party DLLs and Windows DLLs including MFC71] => statically
links with MFC71, but dynamically links using LoadLibrary/FreeLibrary
with third party DLLs.

Problem:

When I use the .NET Memory Profiler tool, I appear to have a problem
with my third-party unmanaged DLLs leaking memory that they normally
would not leak with a standard Windows program. However, when I
unload the DLLs from within the .NET environment, the Visual Studio
..NET debugger does not report any memory leaks.

For example, with one third party DLL that loads a 9MB DAT file when
it initializes, the committed memory leak is slightly larger than the
DAT file everytime I load and unload the third party DLL using
LoadLibrary and FreeLibrary from my pure unmanaged C++ DLL, and within
..NET Memory Profiler under "Committed Memory -- Potentially Shared --
this growing leak is tied to the dat file that the third party DLL
loads and unloads. If I put this code in a tight loop of load and
unload on the third party DLL, it quickly eats up committed memory
until things start to fail after maybe 1500 cycles. If I keep a third
party DLL in memory by not decrementing its LoadLibrary reference
count to zero, in the .NET Memory Profiler the .DAT file does not grow
beyond 9MB within the committed memory pane: it only grows if it is
actually unloaded and reloaded.

Does anyone have any clues on what might be wrong?

Any suggested Microsoft KB articles I should read?

Any free pizza?
Nov 17 '05 #1
0 1992

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

Similar topics

16
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
1
by: Bruce Vander Werf | last post by:
Our current unmanaged architecture consists of an EXE and several optional DLLs. The list of available DLLs is stored outside of the EXE, and the DLLs are loaded as needed. The DLLs have identical...
12
by: doug | last post by:
I understand the basics of what managed code offers and that you open yourself up to security issues if you allow unmanaged code. We already have a decent amount of VB6 code to include COM DLLs. ...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
3
by: gopal | last post by:
I am developing an application in CSharp - windows forms based, which copies the DLLs both unmanaged and managed DLLs from a shared folder and will overwrite the existing versions of managed &...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
4
by: Technics | last post by:
Ok I will be as clearer as I can (sorry for english/technical mistakes) I would like to write an audio application that supports ASIO drivers. I downloaded the ASIO sdk from Stainberg and I read...
0
by: =?Utf-8?B?Y2hlbG9tYW4=?= | last post by:
Hello, I’m trying to use an unmanaged C dll from a ASP.NET 2.0 web application using p/Invoke platform (dllImport attribute). The asp.net page instances a c# library and this loads the C dll....
3
by: Jim Horvath | last post by:
I know how to create exe applications in dotnet that use functions supplied by pre-existing dlls. How do you turn that around? I want to create an exe program that will be the pre-existing piece....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
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,...

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.