On Sunday, October 14, 2012 23:38:48 Andrej Mitrovic wrote: > toStringz takes a string (immutable(char)[]), and the GC will not > reclaim immutable data until app exit.
If the GC never collects immutable data which has no references to it until the app closes, then there's a serious problem. Immutability shouldn't factor into that at all. Anything and everything with no references to it any longer should be up for collection. Any other behavior would effectively result in huge memory leaks - especially if you're doing a lot with strings. Maybe you're seeing the behavior that you're seeing because the GC mistakingly thinks that something points to it (as happens sometimes - especially in 32- bit programs). - Jonathan M Davis