taliesins / cassia

Automatically exported from code.google.com/p/cassia
1 stars 0 forks source link

Memory leak #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I think there is a memory leak, but I couldn't figure out where is it.

if I call the following function several times, with some delay of 20 sec, then 
I can see that my program memory is going up and up:

public static IList<ITerminalServicesSession> GetMachinesSessions(string 
machineName)
        {
            ITerminalServicesManager manager = new TerminalServicesManager();
            using (ITerminalServer server = manager.GetRemoteServer(machineName))
            {
                server.Open();
                return server.GetSessions();
            }
        }

So do you think that maybe there is some memory leak?

Thanks,
Tomer

Original issue reported on code.google.com by tomerpe...@gmail.com on 9 Mar 2011 at 9:51

GoogleCodeExporter commented 8 years ago
Tomer,

It's possible. Have you verified that this is not simply because the GC hasn't 
kicked in yet?

Original comment by danports on 9 Mar 2011 at 11:38

GoogleCodeExporter commented 8 years ago
Yes, it seems that the gc handles only the last created instances.
I let it run for something like 4 hours...

I'll try to track it somehow and let you know if I'll find something.

Original comment by tomerpe...@gmail.com on 10 Mar 2011 at 6:57

GoogleCodeExporter commented 8 years ago
I tried and failed to reproduce this issue. Attached is the sample program I 
used for testing. I ran this for 5+ hours (at about 8 queries/second, that's a 
total of over 140000 queries) and saw no clear upward trend in memory usage, as 
would be expected. I'm guessing that what you are seeing is either a memory 
leak elsewhere in your program or the normal GC behavior. I'm closing this 
issue for now, but if you have a sample program that can reproduce this issue 
or any other information about it, I'd be happy to review it.

Original comment by danports on 14 Apr 2011 at 12:22

Attachments: