 Memory can be treated as a resource, but memory management is usually considered separately, primarily because memory allocation and deallocation is significantly more frequent than acquisition and release of other resources, such as file handles.Memory managed by an "external" system has similarities to both (internal) memory management (since it is memory) and resource management (since it is managed by an external system).Examples include memory managed via native code and used from Java (via Java Native Interface); and objects in the Document Object Model (DOM), used from JavaScript.