It goes both ways. For the last two JavaOne's the HotSpot guys have been
very adament about the fact that you should not use pools. IBM uses a
different approach and a recent article still recommends pools. I want to
believe the HotSpot guys as it simplifies programming.
>From the HotSpot FAQ:
http://java.sun.com/docs/hotspot/PerformanceFAQ.html
Q: Should I pool objects to help GC? Should I call System.gc() periodically?
Should I warm up my loops first so that Hotspot will compile them?
A: The answer to all of these is No!
Pooling objects will cause them to live longer than necessary. The garbage
collection methods will be much more efficient if you let it do the memory
management. We strongly advise taking out object pools.
Don't call System.gc(), HotSpot will make the determination of when its
appropriate and will generally do a much better job. If you are having
problems with the pause times for garbage collection or it taking too long,
then see the pause time question above.
Warming up loops for HotSpot is not necessary. HotSpot now contains On Stack
Replacement technology which will compile a running (interpreted) method and
replace it while it is still running in a loop. No need to waste your
applications time warming up seemingly infinite (or very long running)
loops in order to get better application performance.
IBM with their JIT is still advocating object pools. See:
http://www-106.ibm.com/developerworks/ibm/library/i-tuning/?loc=tstheme
In the coding tips section:
- Implement object reuse as much as possible. Try to create few new objects.
- Cache frequently used objects whenever possible. Caching objects eliminates the
time needed to allocate new objects, and also reduces the frequency of garbage
collection. In applications, cache frequently used objects for reuse. In libraries,
keep pools of new objects available.
----- Original Message -----
From: "marc fleury" <[EMAIL PROTECTED]>
To: "Jboss-Development@Lists. Sourceforge. Net"
<[EMAIL PROTECTED]>
Sent: Wednesday, June 27, 2001 2:30 PM
Subject: [JBoss-dev] Instance pools
>
> There was also a lot of talk last year around "real men don't use pools,
> they use modern VM technology" and while I don't know where that is at these
> days it will simplify the design so much that I am really tempted..
>
> any religious feelings?
>
> marcf
>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development