Important: The information in this document is obsolete and should not be used for new development.
Reference Counts
The Code Fragment Manager keeps a reference count for every connection currently in a process. This value indicates the number of closures that reference the connection. For example, in Figure 1-2, the shared fragmentsdogLib
andcowLib
each have a reference count of 2. If the plug-in is released, the reference count for each would be decremented. When the reference count of a connection drops to zero, the connection is not part of any closure and the Code Fragment Manager is free to release it if necessary.The Code Fragment Manager also keeps similar count values for each section of a shared fragment that indicates the number of connections associated with it. For example, in Figure 1-4, the code section for
dogLib
has a reference count of 2, and the two data sections fordogLib
each have a reference count of 1. If the process containingdogApp
terminates, the reference count for thedogLib
data section in that process drops to zero, so the Code Fragment Manager can release the section. The reference count for the code section only drops to 1, however, so it remains in memory.Finally, the Code Fragment Manager also keeps track of the number of connections associated with a given fragment container. If a fragment container has no connections associated with it, the Code Fragment Manager can release the container from memory.