• Welcome to Valhalla Legends Archive.
 

BNSimulator: bot development tool

Started by Tuberload, October 21, 2003, 12:09 PM

Previous topic - Next topic

Banana fanna fo fanna

Quote from: Adron on October 23, 2003, 05:34 AM
Seems to me like java's memory management is very bad. It will allocate lots of memory from the system and not bother to return memory to the system even if the system is running low on memory and the memory has no references inside java.

"Java" is a lot of different things, which is hard for a lot of people to realize.

Java is:
- A syntax definition, the sematics of declaring a class, etc
- A standard library definition, the class names and what they do
- A class file format definition, the bytecode that is in .class files
- A virtual machine definition, a description of the behavior of a VM

You're probably talking about how sucky the Sun "reference implementation" is. This is the package you get from java.sun.com. I agree with you, it's pretty bad. There are alternatives you can use for each component of java. For the syntax definition (source code compiler), I've found that IBM's jikes compiler is about a bazillion times better than javac. The classpath.org GNU classpath is a GNU implementation of the Java standard library. The class files and VMs have been implemented by several third parties, like BEA, GNU, kaffe, etc.

I agree that Sun's tools really suck, but if there was a truly good implementation, Java could take off.

Tuberload

Quote from: St0rm.iD on October 23, 2003, 02:09 PM
I agree that Sun's tools really suck, but if there was a truly good implementation, Java could take off.

Faster than it already is.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Adron

Quote from: Tuberload on October 23, 2003, 06:48 AM
From what I have been reading alot of that has to do with the JVM you are using. I just started reading on the subject, so I have no real opinion except what do you concider to be worse: a program that hogs memory, and only returns it when finished, or, a program that may have a leak somewere and never return the memory?

A program that has a leak somewhere and never returns the memory is just the same as a program that hogs memory and only returns it when finished in at least 95% of the cases. Reading that article, it seems that every Java program will by default leak <insert java interpreter heap size> megabytes of RAM before starting to free up memory that *should* be free.

Adron

Quote from: St0rm.iD on October 23, 2003, 02:09 PM
You're probably talking about how sucky the Sun "reference implementation" is.

I was talking about this quote from the article iago posted a link to:

Quote
The Sun JDK 1.1.8 uses a default 1 MB startup setting and a 16 MB maximum setting. The IBM JDK 1.1.8 uses a default maximum setting of one-half the total physical memory size of the machine. These memory settings have a direct impact on what the JVM does when it runs out of memory. The JVM may continue growing the heap rather than wait for a garbage collection cycle to complete.

Given this, an application running in IBM JDK could use up half the physical memory before the IBM JDK considers returning some memory to the operating system, even if the application only really needs 1 megabyte or so.

Skywing

Quote from: Adron on October 24, 2003, 05:23 AM
Quote from: Tuberload on October 23, 2003, 06:48 AM
From what I have been reading alot of that has to do with the JVM you are using. I just started reading on the subject, so I have no real opinion except what do you concider to be worse: a program that hogs memory, and only returns it when finished, or, a program that may have a leak somewere and never return the memory?

A program that has a leak somewhere and never returns the memory is just the same as a program that hogs memory and only returns it when finished in at least 95% of the cases. Reading that article, it seems that every Java program will by default leak <insert java interpreter heap size> megabytes of RAM before starting to free up memory that *should* be free.
I remember a certain person explaining to me how NBBot's unlimited size command history was completely different from a memory leak...

Tuberload

I doesn't make sense why Sun doesn't just allocate the needed amount of memory at run time, and then re-allocate more as needed... Then again a lot of things don't make sense.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Adron

#36
Quote from: Skywing on October 24, 2003, 02:52 PM
I remember a certain person explaining to me how NBBot's unlimited size command history was completely different from a memory leak...

Hmm? It is indeed very different from a memory leak. That's memory in use, not just memory hogged. You can go through all those commands using the up and down arrows. Memory hogged would be like the java compiler allocating memory up to half the physical ram (say 512 MB) when it could really just garbage collect and reuse a single megabyte 512 times instead.


|