I like to create my own wallpaper changer. I know that there is a lot on the Internet, but I'm just trying to learn new things. So, so far, every time I created any simple program, I did not care about RAM / Memory, because I basically created programs for the school, and it was like a one-time program, and then I forgot about it .
But now I'm trying to create an application that I would like to use, something of mine. I noticed that my program takes about ~ 4000 thousand. In the "alt + ctrl + del" window, and sometimes it takes up to 200 000k when it changes the wallpaper, and sometimes it decreases and sometimes remains high until it changes to another . 
So, the question arises: what are the tips for my application to use the least possible ram while working (tray icon, and the main windows are hidden using if (FormWindowState.Minimized == WindowState) Hide(); )
Is a variable inside a function occupying any memory? Example
int function(int a){ int b = 0; int c = a+b; return c; }
Or are these variables freed after the function returns some value?
I could use some tips, guides and / or links to articles where I could get some information about this. Friendly is yours.
EDIT: Okay, I read something, started disposing of bitmap images, got rid of one of my global variables that I used .. and its on a stable 4000-7000k now. Raising a little when changing the wallpaper, but then dropping to it. Therefore, I assume that this is a success for me. One more thing left. I downloaded kinda big / large / with many optional programs that change the wallpaper, and it has more features than mine, and yet it takes about 1000-2000 thousand, so ima is now reading that it can take so many "rams " in my. Right when I run my program around 4100, I think I can still do something to optimize it. Thanks everyone for the answers! :)