Memory problem in asp.net calling unmanaged DLL

Discussion in 'ASP .Net' started by monika.saxena, Jun 13, 2005.

  1. Hi all,

    In one of my projects which is a web based application in asp.net, a
    third party tool - "Frontline Solver DLL" (It is an unmanaged DLL and
    ..NET is calling it using the PInvoke) is used. This DLL is used for
    solving and optimizing some non linear problems.



    Problem : The problem I am facing is as the solver runs and does the
    optimization the memory usage of the aspnet_wp.exe process keeps on
    increasing gradually. The memory does not come down even after the
    optimization is complete till aspnet_wp.exe is manually killed from
    task manager. Sometimes, the solver stops in between once the memory
    has increased considerably. But no specific pattern is present for the
    same.


    Cause : The solver DLL is not freeing the memory which is unmanaged
    memory (even after calling the functions to free the same). Also the
    Garbage collector is not collecting managed memory as soon as the
    optimization stops as garbage collection takes place at its own
    periods.


    Tried outs :

    Freed the unmanaged memory calling the
    System.Runtime.InteropServices.Marshal.FreeHGlobal

    Freed the memory calling GC.Collect()

    Increased the RAM of system, but still the problem persists i.e.
    stopping of the solver in between.

    Increased the Virtual Memory to 3 GB in boot.ini

    In Machine.Config, tried out by changing the memory limit to 80% as
    well as 40%


    Look-for : Want to know some way of cleaning the memory when the web
    application is still open but the optimization is complete. So that
    once the solver is run again, it does not add to already increased
    memory.

    Hoping to get some response.
    Thanks in advance.
    Regards,
    Monika
     
    monika.saxena, Jun 13, 2005
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.