4/4 JVM usually takes care of stack memory fragmentation right? (Sun's
\_ Wrong. You've confused stack & heap.
JVM is mark&sweep with conservative compacting algorithm) What
about compiled code? Let's say I have a C/C++ server running that
keeps doing new+delete, some big, some small. Eventually, there will
be a lot of fragmentation. What happens?
\_ This depends on what your server is doing. Depending on your memory
allocation regime you may consider using a garbage collection
library or implementing your own memory management layer.
\_ C++ by default ends up fragging the heap. In general, assuming
you don't run forever, this isn't too bad a problem. If the
server is doing alloc/free's all the time and runs for a long time
you should consider rolling your own memory allocator. - seidl
\_ Yeah, it's like this: either you care a LOT about memory
performance, or you prefer to have ease of use. If you
want ease of use you just alloc away and don't care. If
you want performance you write your own allocator that
does exactly what you want. In games we use a mixture
of these two things based on how frequently a particular
allocation is going to happen. -blojo
\_ blojo, what game are you talking about? Solitaire?
\_ If yer gonna say something dumb at least sign
your name so I can laugh at you. -blojo
\_ Yeah, you never say anything dumb, John.
\_ It helps if you can spell his name --oj
\_ When I say dumb things, i sign my name
to them, dammit. -blojo |