473,695 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.


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 2058

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

Similar topics

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, or other controls depending on the particular form. This application is setup with one MDI parent calling MDI children with the exception of one Modal form (the report viewer). When I run the application and run one of the screens that pulls...
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 calling interfaces. The program dynamically links to a number of routines in the DLL, and the DLLs, when loaded, dynamically link to a number of routines in the EXE. As we move the application to .NET, we are considering several possibilities...
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. If we put wrappers around some of our code or leave some "asis" what makes our existing production code 'evil' just because it is now considered 'unmanaged'? It may seem like a simple niave question, but the definitions for managed and...
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 really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
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 & unmanaged DLLs into folder where some .NET application and a VB application has been installed. To be more clear, i will make some chnages to DLLs and using this tool(developed in CSharp) i will overwrite the existing version of DLLs - unmanaged...
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
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 the docs and viewed the code provided. The sdk retrieve the varius ASIO drivers available from windows registry. The various drivers are COM objects wich must be loaded dinamically after retrieving the CLSID from the registry. In C++ this is...
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. I’ve used this dll from a windows application without problems. But if this dll is invoked from a Web site it always return this error: “Attempted to read or write protected memory. This is often an indication that other memory is corrupt”...
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. It's functionality can then be extended (using new dlls) without re-compiling the exe. My proposed program is a test sequencer for an industrial control application. I want the exe to handle common housekeeping functions (stepping through...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.