WebBrowser memory problem

后端 未结 3 991
悲哀的现实
悲哀的现实 2020-12-10 16:54

I have a .NET application that needs uses a WebBrowser to automatically navigate through a bunch of pages. But if I go to, for instance, Google and set Google I

3条回答
  •  庸人自扰
    2020-12-10 17:21

    Windows doesn't really return freed memory if there's nor reason for it. And the only reason would be if another app requires that memory and there's no other memory available anymore. That's why it looks as if the memory use increases.

    Try calling

    SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);

    sometimes - this will force the OS to return all freed memory back to the OS.

提交回复
热议问题