File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Low memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Low memory" Watch "Low memory" New topic

Low memory

Louis Smith

Joined: Apr 14, 2007
Posts: 4

A very senior technical member of our company, commented on a large read only
cache, that we are implementing soon, which being low on memory is a worry. He said in email that he knows how to ammend this. We will meet with him again soon and don't want to appear foolish.

The Operating System is HP multiprocessor (4 CPUs), running under Unix.

We thought about tuning the JVM ie. granting as much memory as possible
to the JVM, setting the -Xms and Xmx to the same value, and the following two thigs:

The -XX:+AggressiveHeap option inspects the machine resources (size of memory and number of processors) and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs. It was originally intended for machines with large amounts of memory and a large number of CPUs, but in the J2SE platform, version 1.4.1 and later it has shown itself to be useful even on four processor machines. (i.e., the algorithms attempt to use heaps nearly as large as the total physical memory).

The concurrent low pause collector uses a separate garbage collector thread to do parts of the major collection concurrently with the applications threads.

Are there any other ways to minimize the memory size of a Map, which is the cache for a database table, or a better candidate data structure or other tuning

Thank you,

Louis Smith
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 862
Look into to the many java cache options before coding it yourself. Here are some open source offerings:

There are also some commercial caching packages. - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
Thanks Steve, this is helpful.


I agree. Here's the link:
subject: Low memory
It's not a secret anymore!