I'm trying to figure out if I should be worried about memory usage for this situation. I would like to launch lots of "lnk" shortcuts in a c# application. I'm wondering why I see a memory usage difference between launching lnk files vs launching exe files:
Process proc = new Process();
for (int i = 0; i < 20; i++)
{
proc.StartInfo.FileName = "c:\\somefolder\\shortcut.lnk"; //vs "c:\\somefolder\\someapp.exe"
proc.Start();
}
The main c# program uses around 500 kilobytes per shortcut launched. Even after the "shortcut launched" applications close this memory never seems to be freed.
I've tried doing proc.close() or proc.dispose(), and I've forced the garbage collector to run to see what will happen. Nothing I do change the "shortcut launched" memory usage.
In contrast, when I launch the executables directly, the main program doesn't appear to use more memory per process launched.