Memory leak in the Win64 Delphi RTL during thread shutdown?

后端 未结 3 1856
抹茶落季
抹茶落季 2021-01-31 02:46

For a long time I’ve noticed that the Win64 version of my server application leak memory. While the Win32 version works fine with a relatively stable memory footprint, the memor

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 03:22

    In order to avoid the exception memoryleak trap, you could try to put an try/except around the FoobarProc. Maybe not for a definitive solution, but to see why the axception is raised in the first place.

    I usually have something like this:

    try
      FooBarProc()
    except
      if IsFatalException(ExceptObject) then // checks for system exceptions like AV, invalidop etc
        OutputDebugstring(PChar(ExceptionToString(ExceptObject))) // or some other way of logging
    end;
    

提交回复
热议问题