2 ms·
It's not the gc that causes this problem. The problem is: you allocated a block of, say, 100KB. Then you needed two 10KB subsets of that block. While you're usi
by icebraining 13y ago
It's not the gc that causes this problem. The problem is: you allocated a block of, say, 100KB. Then you needed two 10KB subsets of that block. While you're using those, you may stop needing the rest of the block. How do you create those subsets? Do you just point to the original memory? Then you can't free() the 80KB you don't need anymore. Do you copy those 20KB? Then you're potentially using more memory than necessary.
The problem holds even if you're not using a gc or refcounting at all.