Ok so I made some tests, asked around on a few forums (
FP,
SO) and I ruled out OS as the cause of the problem. Someone on FP mentionned that using Sleep ceased the problem, so it might be a timing related issue, maybe the GC doesn't have enough time to clean things up?
Either way, I think I know what the real problem is; the use of unmanaged objects. If you make a loop in the frame of say a thousand iterations and create a new shape a thousand times a frame, it will consume enormous memory and fill up your RAM in no time because you are referencing unmanaged objects. However, I reproduced the Shape class in managed C# and did the same experiment, it all goes fine with next to no overhead.
What I'm basically saying is that the best way to do this, in my opinion, would be to have functions that directly draw things (Text, Shapes, maybe even Sprites?) and writing the classes in managed C#. Only one DllImport, the draw call (which would be huge, but still) would be needed.
I really really love this project, the simplicity of it, and I love .Net, so I dream of combining the two. However, right now, it isn't really possible to use SFML in the ".NET mentality", that is we have to be careful not to leak memory and whatnot.
I would be willing to help out with this, I tried checking it out but I barely know C and C++ and I couldn't really understand what was going on (.Net is a binding to C which in turn uses C++?) but I would be more than glad to write the managed classes for you if you ever decided on such a path. I understand that the .Net binding must be your last priority but I think it could turn out great.
If you want, email me and we can talk about this (I speak french if that can help).[/url]