|
iPAM Developer Documentation
|
|
- Product Pools and Memory Sizes |
|
Java's memory management system does not always keep up the needs of very dynamic channels. In iPAM agents that create large byte arrays as the content of the agent's product may run out of memory because the memory allocations are too small or because the garbage collector has not kept up with products that are no longer used. The paragraphs below address these two concerns.
Java allows you to specify the initial heap size and maximum heap size for your Java application. See Sun's Java documentation for how to use the the-ms
or the-mx
command line options for the tooljava
(or-Xms
and-Xmx
).
Another technique that iPAM developers may use is to exploit product pools. A product pool is an iPAM Java object that keeps track of a preallocated collection of products. Once the product pool is created (with preallocated products) the agent is free to get the next unused product from the pool and then use it as its output. Since products in the pool are never freed, the agent is free from much of the dependence on Java's memory managment system.It is still possible to have problems even if product pools are used if products get many changing attributes assigned to them. The product pool can only contain a reference to the product. Byte array products have references to their working array. But String, URL, and FileRef products will still need to allocate their contents dynamically, beyond the help of the product pool
For an example of using product pools see the source code for
org.mitre.pam.getter.TestAsyncSource in pamStandard
.
Revised: 14 September 1999