Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Memory Graphs and GC

Name: Anonymous 2011-10-06 11:20

When looking at the amount of memory in use how should it's graph look like?

should it be slow steady rise?:
http://i.imgur.com/2LuWz.png

Rise->big drop:
http://i.imgur.com/0Mg2S.png

Trig function like patterns:
http://i.imgur.com/wjBlt.png

I'm in the process of making a java program and when i first start out it looks like the steady/no increase flat line, but then once i start using some of my other objects i get the rise-drop due to the allocation of new stuff per frame.

I've also tried start caching a lot of things that i feel will eventually repeat (like texts drawn) that why it doesn't have to keep allocating/deallocating them per frame.

Name: Anonymous 2011-10-06 11:24

When looking at the amount of memory in use how should it's graph look like?
A good program allocates all required memory at the start.

Name: Anonymous 2011-10-06 11:37

>>2
Well how would you make a dynamic program that will change over time?

Name: Anonymous 2011-10-06 12:47

>>3
Throw in a memory leak.

Name: Anonymous 2011-10-06 12:54

the only hard and fast rule is that it shouldn't leak.

In Java it's basically impossible to prevent dynamic memory allocation of a lot of things. For instance, if yo have a 2d vector class, new ones will generally be heap objects, even intermediate ones.

The advice here is to have more function that do more and don't use a lot of intermediate vectors, or pass around numbers instead of objects, since numbers live on the stack in Java.

Name: Anonymous 2011-10-06 13:03

GC is shit.

Name: Anonymous 2011-10-06 13:05

>>6
fuck off and die, faggot

Name: Anonymous 2011-10-06 14:07

it should increase like an exponential curve

Name: Anonymous 2011-10-06 14:23

GC: keeps rising until it hits the limit, then drops sharply (accompanied by a sudden slowdown of the program) as the GC runs.

Sane memory management: always mirrors the memory needs of the program.

Name: Anonymous 2011-10-06 14:28

>>9
Ever heard of escape analysis, memory pools, using the GC when appropriate and fuck you you cock sucking spammer?

Don't change these.
Name: Email:
Entire Thread Thread List