I am working on a little bookmark managing app written in C#, using WPF. It just sits in the system tray and is idle 99% of the time. Recently I looked in the task manager and discovered that it uses around 25 megs of memory (and around 12 megs before it is activated for the first time) which I thought was a bit much for an app that does nothing most of the time. That made me wonder if there are any ways to reduce the memory usage by, e.g., disabling WPF features that are optional.
I have discovered one fact which might lead to something, though I don't know any way to leverage it. Threads in .NET take around one meg each, and it turns out my app uses around 6/12 threads (before and after being activate for the first time). This accounts for half my memory usage which is rather significant. I dont spawn any new threads directly, but I have no idea of how WPF, as well as other parts of .NET, uses threads for different tasks so I find it hard to do anything about it. Using events for stuff that is not directly related to the GUI, does this for example spawn new threads?
So I guess my question is twofold, how can you reduce the memory usage .NET/WPF applications in general and how can you minimize the number of threads being spawned? Note that I'm not so much thinking about small details such as those brought up in this answer, but rather how to design for low memory usage throughout your entire application.