View Single Post
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#155
Originally Posted by Joorin View Post
Just to add a tiny nuance: C# offers pointers if you agree to be on your own, taking full responsibility for it all.
In what way is that different from C++ ? Admittedly the 'usual C++ way' is heavy with pointer use, but that's not a requirement by any means.

Originally Posted by zimon View Post
When I have time, I try to prove that slowing down of my Firefox is due to heap memory fragmentation.
Just make sure Flash and javascript are disabled as those might prevent the release of memory.

No *malloc can remove fragmentation totally, because alive objects cannot be moved in the heap if pointers are allowed in the code (C/C++).
That is sort-of true for *unmanaged* pointers, but for example if you use Qt, most of your objects would be QObjects or wrapped in smart pointer classes which allow Qt to do whatever it wants memory-wise as it 'knows' about what is where.

I could point to some studies done for GC+memory management, but you guys can find them yourselves also with google.
This is a fairly difficult question for several reasons. One reason that you do not know the link between the heap and the physical memory (swap, virtualization, etc). Thus, if suddenly your memory manager decides 'hey if I move this there might be space for that new object' it might actually cause a performance decrease depending on what needs to be done in heapspace. If a VM tries to take over the OS's memory management function, that's always a dubious outcome.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc