Do you talk about the newspace and the difference between short lived and long-lived objects at all? (Sometimes called the "eden".)

From JDK5 forward I have had no gc pause problems at all by simply following two simple rules. Obejcts should be EITHER short lived or very long lived. Short lived objects are generally colletable without apparent pauses. Long lived ones can cause pauses and therefor should be treated like memory allocation in C and only released during pause periods like level changes.

Got a question about Java and game programming? Just new to the Java Game Development Community? Try my FAQ. Its likely you'll learn something!

From JDK5 forward I have had no gc pause problems at all by simply following two simpel rules. Obejcts should be EITHER short lived or very long lived. SHort lived objects are generally colletable without apparent pauses.

Exactly what are you classifying as 'short lived'? Recently (particularly for my scrolly shooter) I've only really worried about avoiding *really* short lived objects (mainly temporary Vector2f etc. used for per enemy/bullet per frame updates). Stuff like bullets - which can easily have multiple new objects per frame, and last for a couple of seconds - I can happily new and discard without any noticable framerate hit or jerkyness. And all without any sort of GC tuning I might add.

The article uses standalone visualization tools, so doesn't talk about support in NetBeans, Eclipse, etc.

I use PDF because it's a cross-platform format that's easy to generate from MS Word, and still looks like the original document.

There's a lot about short and long-lived objects in the article.

Short-lived objects are collected from the young generation space (new space) after a few seconds. If they live longer, they'll eventually be moved to the old generation space (tenured space). GC from the tenured space can be a factor of 10 slower than the new space, so it may be useful to adjust the space sizes to keep objects in the new space.

But, like everything, if your application doesn't have a problem with GC, then there's no need to fine-tune it.

From JDK5 forward I have had no gc pause problems at all by simply following two simpel rules. Obejcts should be EITHER short lived or very long lived. SHort lived objects are generally colletable without apparent pauses.

Exactly what are you classifying as 'short lived'? Recently (particularly for my scrolly shooter) I've only really worried about avoiding *really* short lived objects (mainly temporary Vector2f etc. used for per enemy/bullet per frame updates).

Yup. And I wouldnt even worry about those unless the cost of creating them is heavyweight.

In a quick and dirty port of a game app i have to write a fake socket provider layer and was allocating multiple Buffer objects all up and down the chain for each pcaket.

I saw NO hit

I love the newspace and how they finally have it tuned

Got a question about Java and game programming? Just new to the Java Game Development Community? Try my FAQ. Its likely you'll learn something!

Actually PDF is format created and maintained by Adobe, so it's not exactly crossplatform any more than PS or DJV, and it's incredibly hard to download on computer especially compared to HTML file (You don't have bandwidth limits on your site right? ~_^). Also it's kinda hard to read without viewer.(Actually PS is harder to read, because I still didn't managed to add a nice PS reader on my computer.)

Actually PDF is format created and maintained by Adobe, so it's not exactly crossplatform

UM I disagree. Adobe works very hard to keep readers availabe on just about every paltform knwon to man. Ergo it may not be free but it is cross paltform.

As an aside tangential to the point, but not necc to your response, they also publish that standard in public. I wrote a PDF viewer in Java years ago. The only thing that prevented me from releasing it is that PDF uses LZW and at the time LZW was controlled by Univac.

Quote

and it's incredibly hard to download on computer especially compared to HTML file

How it harder then any other file?? Comapring it to HTMl isnt a very fair comparison because PDF is a complete page markup langugage. HTMl is a highly limited rpesentation language. Aditionally, PDF gives you exact control over how the end product looks on all viewers, HML does not.

Quote

(You don't have bandwidth limits on your site right? ~_^). Also it's kinda hard to read without viewer.

Viewer is free. Go to Adobe's site and download.

Got a question about Java and game programming? Just new to the Java Game Development Community? Try my FAQ. Its likely you'll learn something!

Alas because of my neighbourds, I'm still on dial - up pay per minute. Going to adobe site and download something is completely ot of my fiscal posibilities. Not to mention the HD space on computer that I use for Internet connection is limited too much to alow instalation of Adobe reader.

HTML 64 KB <<< PDF 640 KB

Of course HTML has another helpful features, It's easirer for reading, and it alows better indexing and searching. (Not to mention the possibility to take an image file and by irphanviewer use a few filters to look at specific part of the image.)

Imposibility of reformating PDF files is also sometimes problematic. You know some documents were formated for printing, not for viewing on computer screen. In fact they are HARD to read because PDF hold formating so well.

c

c

So summary.

PDF

HTML

simple TXT

RTF

Ease of compresion

0.8 (1.25x)

(majority at least 2.4x up to 5x)

2.2 up to 4.8

majority 2.4x

Proxy caching

x

yes

yes

yes

[/tr

]

Refurmating possibile

no

yes (by editor or by hand)

yes (easy)

need wordprocessor

indexing

by Adobe reader could be 30 min

yes standard F3 on windoze, or MC, or by easy to write program

the same as HTML

size on disk for 10000 files

freekingly high 860KB - 120MB/file

manageable

easy

kinda easy

Could show intention of developer well

yes

yes

could

could +formated

error detection

yes

no

no

just rarely yes

Other isues

too static

if

not careful could be too wide, pople are using bad tools to create HTML

x

badly readable by notepad

Other Adobe reader startup is 15-20 sec, it shows that ugly patent numbers on the startup. Incompatibilities between versions, and 2.5 hours between I could download PDF and look at it at my development computer.

I've tried to tweak the garbage collection adjusting the parameters of heap size, new heap size, using parallel GC, etc. but my animations remain abrupt (I just use Java2D for some scrolling sprites). I have also noticed that the -XX:MaxGCPauseMillis doesn't seem to apply to full GC so, in my case, it's part of the problem.

Anyway thank you Andrew for the document, it has been a valuable help.Guillaume

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org