I'm hunting for some memory-leaks in a long runing service (using F#) right now. The only "strange" thing I've seen so far is the following:
- I use a MailboxProcessor in a subsystem with an algebraic-datatype named QueueChannelCommands (more or less a bunch of Add/Get commands - some with AsyncReplyChannels attached)
- when I profile the service (using Ants Memory Profiler) I see instances of arrays of mentioned type (most having lenght 4, but growing) - all empty (null) whose references seems to be held by Control.Mailbox:
I cannot see any reason in my code for this behaviour (your standard code you can find in every Mailbox-example out there - just a loop with a let! = receive
and a match
to follow ended with a return! loop()
Has anyone seen this kind of behaviour before or even knows how to handle this? Or is this even a (known) bug?
Update: the growing of the arrays is really strange - seems like there is additional space appended without beeing used properly:
return! loop()
in side a try/catch block: moiraesoftware.com/blog/2011/12/11/fixing-a-hole . I don't think it is the case with your program. – SuntanDoEvents
from time to time (no kidding) all memory-leaks are gone - seems like there is some kind of bug that blocks the finalizer-thread if the oskb is running. Now the problem is that I don't really know what to do with this question - shall I delete it or is this a good clue for other people having the same issues? - What do you think? – Dictatorial