Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With generational GCs, use of short-lived immutable objects is generally more efficient than use of long-lived mutable objects, such as object pools. Avoiding object pools improves the garbage collector's efficiency. Object pools bring additional costs and risks: they can create synchronization problems and can require explicit management of deallocations, possibly creating problems with dangling pointers. Further, determining the correct amount of memory to reserve for an object pool can be difficult, especially for mission-critical code. Use of long-lived mutable objects remains appropriate in cases where allocation of objects is particularly expensive (for example, when performing multiple joins across databases). Similarly, object pools are an appropriate design choice when the objects represent scarce resources, such as thread pools and database connections.

The rules "FIO00-J. Defensively copy mutable inputs and mutable internal components" and "OBJ09-J. Defensively copy private mutable class members before returning their references" promote GC-friendly code.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0e496e266e419dcd-e6ac854e-4eff4cbf-9699becf-f6587bed55bd83960cfd2c09"><ac:plain-text-body><![CDATA[

[[MITRE 2009

AA. Bibliography#MITRE 09]]

[CWE-405

http://cwe.mitre.org/data/definitions/405.html] "Asymmetric Resource Consumption (Amplification)"

]]></ac:plain-text-body></ac:structured-macro>

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f9d6334877a720d9-fd834268-4ea04e28-bd7bbfd3-5f5c1fd3d8807af5e8ddc144"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API 06]]

Class System

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="fe6d612fef77d3a0-76961a70-485245fc-8b6f9cdd-dc917fa1decc248d02ba1697"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. Bibliography#Bloch 08]]

Item 6: "Eliminate obsolete object references"

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0c4598871e5732a1-fb69b870-4dd5456b-acd6aaaf-fc8cc0f7588f624877907da1"><ac:plain-text-body><![CDATA[

[[Coomes 2007

AA. Bibliography#Coomes 07]]

Garbage Collection Concepts and Programming Tips

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6a5dd0c1050a6fbc-e7d9ed1c-411d4b01-b589a6ff-e7128607d0bb0986f134030f"><ac:plain-text-body><![CDATA[

[[Goetz 2004

AA. Bibliography#Goetz 04]]

Java theory and practice: Garbage collection and performance

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="fec8b2e0409d4f67-ef8539a3-4b6e4c7c-a9c89de6-6717bfa0827cc8e3ddf6a3f6"><ac:plain-text-body><![CDATA[

[[Lo 2005

AA. Bibliography#Lo 05]]

Security Issues in Garbage Collection

]]></ac:plain-text-body></ac:structured-macro>

...