A huge burst of memory in the C # service, what could be the reason?

I am working on an application for C # service and I have this problem due to which there is no and for some obvious reason the memory for the process will increase from 150 mb to almost 2 gb in 5 seconds and then back to 150 mb . But nothing in our system should be used anywhere near this amount of memory (so this is probably an error). It may be difficult, although the true loop is somewhere, but the CPU usage at that time was very low, so I thought I would look for other ideas.

Now, when we compile the service on a 64-bit basis, the same massive surge will occur, except that it exceeded 10 GB of RAM (mainly a search engine), and this simply caused a lot of problems with the computer and everything on it works. After a while, it turns off, but it looks like the windows are still ready to give it more memory.

Do you have ideas or tools that I can use to find this? Yes, he has a lot of magazines, but nothing in the magazines stands out why this happens.

I can start the service in console application mode, so my next test was to run it in visual studio debugger and see if I could find anything.

This happens only occasionally, but usually about 10-20 minutes after starting. In 32-bit mode, it is cleared and continues to work, as usual. 64-bit mode it will work after a while and uses silly amounts of memory. But I am very fixated on why this is happening !!!

EDIT: Please note the windbg post

+3
source share
3 answers

You are doing the distribution that you let go. Your memory accumulates until the GC starts cleaning and starts cleaning after you. On amd64 platforms, all structures are larger, since pointers, v-tables, and other structures are inherently double the size of x86.

- , . :

.loadby sos mscorwks
!dumpheap -stat

. , , , , , , . CLR Memory Leak.

+1

, CLRProfiler, MS ( ). . , , .

+2

, StringBuilder?

0

Source: https://habr.com/ru/post/1742900/


All Articles