finalizer issues?

Presales question: 

I have a C# project which uses interop to Matlab code compiled as a DLL.

Occasionally I get "Memory could not be read errors", where the stack traces seem to point into finalizers.    Hard to reproduce.

Can/how can the ANTS Memory Profile help troubleshoot this?



  • gr8lakesgr8lakes Posts: 2 New member
    PS - not sure if the issue is in the C# code, or related to the managed/unmanaged interop.
  • Hi @gr8lakes,

    ANTS Memory Profiler (AMP) is more geared towards finding memory leaks where the application doesn't crash and so it's not likely to help in this situation - and if it is in unmanaged memory, then we can't profile it anyway, just report on it.  If we're profiling when it happened we might catch something, but there's not a specific functionality within AMP that would help here.

    I suppose you could snapshot and see if objects still exist on the finalizer queue across snapshots ( see this page), which would mean they are obviously not getting disposed of, but whether they lead to an error or not is anyone's guess.

    Kind regards,
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.