CW and Contenta API Memory Management
CW is a cross-platform application that runs on both Windows and UNIX and uses the Contenta API. On Windows, the Contenta API is COM-based. For Java applications (e.g. CW), the following guidelines must be followed:
- Java code for Windows only – releases of Contenta API objects are done automatically when wrapper objects are garbage collected
- Java code for UNIX or cross-platform - releases of Contenta API objects must be done explicitly by the programmer
- Recommendation: Always explicitly clean up Contenta API objects in custom Java code – for cleaner programming and cross-platform support
CW takes the recommended approach of explicitly releasing all Contenta API objects. This approach should also be followed for any customization to CW and for any custom tools that are written for CW. Below are the memory management guidelines that are followed by CW and should be followed in any java applications that use the Contenta API and in any CW customizations.