✅ Ram leak winforms
i've a problem: my windows forms app consumes more ram when i do smth in it and doesnt free this ram. idk what's going wrong. Please help - https://github.com/ivantr30/AffairList
GitHub
GitHub - ivantr30/AffairList: A programm which helps not to forget ...
A programm which helps not to forget about important tasks - ivantr30/AffairList
32 Replies
you'll need to be more specific about what you want, i don't think anyone is going to go through your whole project for you and tell you what's wrong
$details
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code! (see $code for more information on how to paste your code)
my project is not that big
but idk where is this problem with memory
that's all i know and can't even understand
for example if current usercontrol was changed (logic in AffairList.cs) it consumes 0.3-5 mb more ram
but sometimes it frees(a little bit)
but anyway stucks on a some value
that is very far from a point where i would be concerned
most people still aren't going to go out of their way to dig through your code and identify the issue
and never backs to default state
your program will never 100% free unused memory unless there is pressure from the OS to fully free it
if you think you have a memory problem then run the same workflow for 10+ minutes and see if your memory never stops increasing
ok
so unless you're seeing signifcant constantly increasing memory usage this isn't a problem
ok
thanks
so, the experiment is started

the default was 10.8 mb
now its 16.2
i'll wait for 10 minutes
i've changed some controls, i mean i've done smth in the programm
why are you concerned about these tiny differences in memory usage?
this is basically nothing for a modern PC, unless it's growing way beyond a reasonable amount it's fine
to play devil's advocate, if they do have a minor memory leak in a specific workflow, it's possible you'd see small increases over time
(but they probably don't so this is mostly a test of their patience)
i mean if somebody does too much actions in the program he theoretically can make program consume very much ram
how much is "very much?"
is it more memory than is reasonable for the task being done?
more than 100 mb, for this tiny program it will be huge
100mb isn't much ram if i'm being honest
i mean, that's still not much in the grand scheme of things
unless it keeps going up forever, it's not a memory leak
^
if you notice your ram increasing by ~5mb every time, without fail, and it never frees it up, then you might have a leak
ok
if it gradually increases (but not by 5mb every time and stuff gets freed up), you're fine
ok, thanks
so i will return in 10 minutes and think this conversation over
Learn to use a memory profiler and take a look at every allocations. You will have to help yourself out in such situations. GC based languages (C#/Java) run differently from C/C++, so you need to study their memory usage/footprints before confirming leak or not.
ok, thanks
so i thought that over, memory haven't grown and haven't decreased
same value
thanks for all your suggestions
and i added GC.Collect() after all usercontrol changing and it looks like i helped myself a bit
don't do that
there's no reason to, the GC will collect as needed
ok, thanks
how to mark this post as ended?
$close
If you have no further questions, please use /close to mark the forum thread as answered
thanks
$close
If you have no further questions, please use /close to mark the forum thread as answered