Important: The information in this document is obsolete and should not be used for new development.
QuickTime 6 introduces new APIs for applications that want to exercise very fine-grained control over how memory is used by movies. Most applications, however, will not need to use these APIs, which were first introduced in Mac OS X 10.1, and only work in Mac OS X.
On Mac OS 9, collections of media data (called chunks) that were recently used are, under certain conditions, allowed to persist in handles in the application heap with the “purgeable” flag set. If the memory manager needs to reclaim their memory for other purposes, those handles are automatically emptied. If QuickTime needs the chunks again before they are emptied, it simply clears the purgeable flag and uses them, avoiding the need to reload the data.
The Mac OS X Carbon Memory Manager does not currently implement
the purgeable flag, relying instead on the virtual memory system.
However, the concept of a “purgeable chunk” is still valuable
for QuickTime, since it identifies chunks that were recently needed and
may be needed again in the near future (perhaps depending on user
action). In Mac OS X 10.1 and later, QuickTime keeps track of purgeable
chunks. If the total amount of memory occupied by them exceeds a
per-application threshold called the purgeable chunk memory allowance,
QuickTime empties chunks until the total size is under it. This behavior
can be turned on and off using the MediaSetChunkManagementFlags function,
and the allowance can be configured using the MediaSetPurgeableChunkMemoryAllowance function.
Should you want to force QuickTime to empty all purgeable chunks,
you can call the MediaEmptyAllPurgeableChunks function.
Sets application-global flags controlling chunk management.
pascal ComponentResult MediaSetChunkManagementFlags ( MediaHandler mh, UInt32 flags, UInt32 flagsMask);
Currently the only flag is kEmptyPurgableChunksOverAllowance,
which is TRUE by default.
MediaHandlers.h
Returns the current settings of chunk management flags.
pascal ComponentResult MediaGetChunkManagementFlags ( MediaHandler mh, UInt32 *flags);
WARNING - Do not call this function under QuickTime 5.0.x. It could cause a crash.
MediaHandlers.h
Configures the maximum amount of memory that QuickTime will allow purgeable chunks to occupy.
pascal ComponentResult MediaSetPurgeableChunkMemoryAllowance (MediaHandler mh, Size allowance);
This routine configures the maximum amount of memory that QuickTime will allow purgeable chunks to occupy. This is an application-global setting.
MediaHandlers.h
Returns the current purgeable chunk memory allowance.
pascal ComponentResult MediaGetPurgeableChunkMemoryAllowance (MediaHandler mh, Size *allowance);
This routine returns the current purgeable chunk memory allowance.
MediaHandlers.h
Forces QuickTime to empty all purgeable chunks in this application.
pascal ComponentResult MediaEmptyAllPurgeableChunks (MediaHandler mh);
MediaHandlers.h
Last updated: 2002-07-01