Replicated Cache
How many threads does Ehcache use and how much memory does that consume?
The amount of memory consumed per thread is determined by the stack size. This is set using -Xss. The amount varies by OS. The default is 512KB (for Linux), but 100kb is also recommended. The threads are created per cache as follows: * DiskStore expiry thread - if DiskStore is used * DiskStore spool thread - if DiskStore is used * Replication thread - if asynchronous replication is configured. If you are not doing any of the above, no extra threads are created.
Why can't I run multiple applications using Ehcache on one machine?
With JDK versions prior to JDK1.5, the number of RMI registries is limited to one per virtual machine, and therefore Ehcache is limited to one CacheManager per virtual machine operating in a replicated cache topology. Because this is the expected deployment configuration, however, there should be no practical effect. The telltale error is:
java.rmi.server.ExportException: internal error: ObjID already in use
On JDK1.5 and higher, it is possible to have multiple CacheManagers per VM, each participating in the same or different replicated cache topologies. Indeed, the replication tests do this with five CacheManagers on the same VM, all run from JUnit.