regarding java memory consumption

hello all,

i am developing a multi threaded java application.

the application will run as a service.

the application sends/receives sms. the application stores

the data in the momory as objects and there is a maintainance or

house-keeping phase in the application which runs at every 6 hours.

during the maintainance phase data in the memory is written to

the database. that way the memory(which is a simple arraylist for e.g.)

is cleared.

i was experiencing java.lang.OutOfMemory exception problem.

i specified java -Xmx1000M in the the application bat file

and the problem seems to have disappeared. but after some 15

minutes the application has simply stopped running, its hung.

Questions is? what is the significance of that parameter?

does that mean after the memory of that application exeeds 1000MB the

application will break? also how is this related to the java.exe

parameter in the Task manager. When my application runs, i can see the

mem usage parameter fluctating between 50,000K to 700,000K, does it mean

the application is eating that much memory?

also that values is fluctating, what could be inferred from it?

[1254 byte] By [angeshwara] at [2007-11-26 18:34:59]
# 1

The -Xmx parameter sets the amount of memory to use for the java heap, which is where java objects are stored. The -Xmx value should always be less than the amount of memory installed on the machine, to avoid swapping out the java heap. If the java heap is swapped out to disk, performance will suffer dramatically. How much memory is on the machine?

With -Xmx1000m your machine should have 1.2G or more of RAM (rounded up that means 2G). If not, the try a smaller -Xmx value.

The fluctuating value is usually due to garbage collection, which periodially runs to free up memory that is no longer in use.

jxca at 2007-7-9 6:09:04 > top of Java-index,Java HotSpot Virtual Machine,Specifications...