View Single Post
Posts: 1,341 | Thanked: 708 times | Joined on Feb 2010
#163
Originally Posted by attila77 View Post
Which brings things us to the (repeated) bottom line - C++ as such does not *require* a certain type of memory management, it's not part of the language, so if you have a fancier, smarter way of dealing with allocated memory, give it a go.
The fancier smarter way, like defragmentation when needed, will be more inefficient in C++ than with Java JIT. Java JIT can use real pointers in its JIT'ed code, but C++ with a "fancy" memory management should have all pointers then indirect (or do code morphing). When GC in JVM notices there is fragmentation or the ratio of pagefaults has increased, it can re-arrange the objects and re-JIT the affected hotspots.