I had an application for a long time that displayed data for an image and placed it on top of the PictureBox as a result, for example, the pipeline line of the graphics engine, ...
The dishware common with you was a lack of memory, it was so ...
- 66%
- 67%
- 68%
- 69%
- 70%
- 71%
- 72%
- 73%
- 74%
- 70% β Auto garbage collection
- 71%
- 72%
- 73%
- 74%
- 75%
- 76%
- 77%
- 78%
- 79%
- 80%
- 81%
- 77% β Automatic garbage collection
- 78%
- 79%
- .
- .
- .
And a lot of Auto Garbage Collecting in high memory is about 90% to 97%, ... but it seems that this was not enough, and at some point about 97% and 98% of the system (application) crashed with a memory problem ...
so I came up with this idea to call the garbage collector every few frames, so I did this: GC.Collect ();
GC.Collect it self is to heavy, also when there are too many objects inside the memory ... but when you do not leave too many objects, it works smoothly, ...
There are also many things about completing objects, but I'm not sure if they work correctly, as they naturally end in β x = null
which means that we have broken the connection with this object, but this does not mean that we do not have this object somewhere around the galaxy (for example, you can fill the objectβs destructor with a message and see after it left this object, t destroy it immediately , until you close the application or call GC.Collect / Lack on memory, or maybe random automatic collection), ... until it is destroyed, ... for example as the using directive, he calls the Dispose method himself, and we populate our dispose with obj = null, ... then I'm not sure what I should I have to tell you to write the finalization method manually, but there is one more thing ... there is a marshal object that I donβt know where it came from, and if it works on the whole object, I see that some programmer uses it to release objects, ..., I do not know how this works, but it is possible that it really frees an object from our memory, ...
If you did not find anything useful in this, my first option would be to call GC.Collect ...
You can also set its parameters, so it collects fewer objects than usual.
https://msdn.microsoft.com/en-us/library/xe0c2357%28v=vs.110%29.aspx
Free up resources in .Net C #
I also did not read this completely, but it seems to have problems with the thread and memory: Freeing up resources when the thread is inactive