4 ms·
Java can be written with no garbage collection. 1. Pool the business objects and create them all ahead of time. Restore them to the pool after a thread uses the
by SlipperySlope 6y ago
Java can be written with no garbage collection.
1. Pool the business objects and create them all ahead of time. Restore them to the pool after a thread uses them.
2. Create a String pool and use == for equality checks.
3. Avoid Java constructs that create temporary iterators.
for (i = 1, size=myList.size(); i<size; i++)
creates no iterator whereas
for (Object obj : myList)
does. You employ a profiling tool to find the garbage-creating sections of Java code and rewrite them.
I know of a wall street trade matching engine that operates with no pauses for garbage collection that uses these techniques.