0

I've made a c# apps which is normally around 40Mb RAM usage, but for some reason after 1 day or 2 crash with out of memory exception... What i'd like is to see what is using all the memory, but the problem is that I use Visual Studio 2015 and I can't really leave the debugger running because the process Microsoft.VsHub.Server.HttpHostx64.exe is eating all my memory... I tried to let the program crash and attach VS debugger afterwards, but it just hanged forever... So I'd like to get some help to know how can I dump my process when it goes out of memory and see what is using the mem to eventually figure out why ??


So after letting VS running for 1hour it eventually finished memory dump, turns out the culprit seems: ThreadPoolWorkQueue+QueueSegment 249,928 263,922,932 283,922,912 QueueUserWorkItemCallback 999,999 19,999,980 19,999,980

Looks like I am not correctly dequeuing objects from a ConcurrentQueue class. I will investigate.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
bmigette
  • 59
  • 1
  • 12
  • You should start the program, make a snapshot and then let it run for 1 or 2 hours and then take another snapshot. This shouldn't eat up all your memory. Afterwards you can do a comparision between both snapshots. It would be helpful if you would provide some information about your program. Maybe the comm can help you identifying the memory leak. – Christian Klemm Apr 30 '16 at 19:32
  • Have you tried generating a minidump with a tool such as ProcessExplorer ? – Florent DUGUET Apr 30 '16 at 19:35
  • The problem is that the soft will say at 40Mb for hours, and then at some point it start leaking, so getting dump at start won't help; For process Explorer tool, how can I see what my process is uing as memory / class instances ? PS: My program is a forex trading robot, so maybe something from the market is triggering the issue, but I was not able to recreate by trying to open/close/modify trades, which I believe might be the trigger – bmigette Apr 30 '16 at 19:47
  • Possible duplicate of [How do I take a good crash dump for .NET?](http://stackoverflow.com/questions/24874027/how-do-i-take-a-good-crash-dump-for-net) – Thomas Weller May 04 '16 at 21:28
  • Related: [How to use WinDbg to track down .NET out of memory exceptions](http://stackoverflow.com/questions/26142607/how-to-use-windbg-to-track-down-net-out-of-memory-exceptions/26150591#26150591) – Thomas Weller May 04 '16 at 21:30

0 Answers0