JeffFAQ : Doesn't this VM stuff take up a lot of memory?

Jeff,

I was re-reading for fun your execelent Java FAQ and one statement made me really perplex in the following paragraph taken from http://wiki.java.net/bin/view/Games/JeffOnPerformance#Doesn_t_this_VM_stuff_take_up_a:

[quote]If you use Java utility libraries, particualrly large and compelx ones like Swing, you will pull a fair bit of code in. But thats code you requested and, if you don’t like the cost, you can always write your own replacements. Its really up to you to set your trade-offs between ease of programming and efficiency in java, just liek in any other langauge. Java just gives you more options to chose from.
[/quote]
…if you don’t like the cost, you can always write your own replacements…

Actually, I don’t understand how one could write its own replacement and be authorized to redisitribute a stripped JRE that includes its new libraries? The JRE liscence doesn’t allow that. Did I miss something?

I think he means you can write your own and distubute them w/your app. like swt for example.

but your’re stiil required to have all the Swing libs, as an example, which forces the user to download/install those unused libs anyway.

sure, but you can write your own if you dont like those provided by jdk, choice is yours.

What he means by memory is the amount of memory used by your running application. Not the size of the the JRE that you have to distribute.

ok, the answer is no as long as you dont use a class it will not be loaded into memory an so will not use any memory

OK, my error. My point isn’t related to memory consumption ::slight_smile: but I wanted to say that if you distribute your own libs for a GUI for example you still need to distribute the whole JRE.

well, maybe. you COULD base it all off of AWT (just enough of it to get you a plain old Window object) and then cut Swing from the formula. with that plain Window and Graphics objects you could render your own GUI from scratch. tons of work, but hey - whatever.

Don’t forget you can use AWT without Swing, but you can’t use Swing without AWT :stuck_out_tongue:

also, reserve at least 12 hours (for debugging) per line of code when attempting to build off of AWT. enjoy! :slight_smile:

I think TAK is getting at that the VM distribution is too big - being able to make the choice to develop and distribute you own GUI layer (or use SWT, or whatever) is great but would be 1000x better if you could remove the parts of the distributions that your replacing.

For instance, its wonderful that we can all use what ever GUI implementation that we want, it’d be far better if at distribution time we could remove the default GUI implementation (AWT/Swing).

Kev

SO this is totally irellevent to the FAQ.

But if your inetrested in down laod size Id suggest you chat with cas about soe of what he does,

OR you can JavaWebstart it. if you webstart it then you only need to DL a VM if a compatible one isn’t already available, and that downlaod will only happen once for ALL apps that are compatible for that VM.

Actually, the BEST way is porbably to install the VM auto updater and then you will have updates abckground downloaded automagically.

BTW… IMHO peopel make way too big a deal out of DL size anyway.

I downlaod a heck of a lot more every time CoH/CoV releases a game patch…