⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memoryusage.java

📁 这个是perst-269.zip下面的SOURCECODE,和大家分享了。
💻 JAVA
字号:
package org.garret.perst;

/**
 * Information about memory usage for the correspondent class. 
 * Instances of this class are created by Storage.getMemoryDump method.
 * Size of internal database structures (object index, memory allocation bitmap) is associated with 
 * <code>Storage</code> class. Size of class descriptors  - with <code>java.lang.Class</code> class.
 */
public class MemoryUsage {
    /**
     * Class of persistent object or Storage for database internal data
     */
    public Class cls;

    /**
     * Number of reachable instance of the particular class in the database.
     */
    public int nInstances;
    
    /**
     * Total size of all reachable instances
     */
    public long totalSize;

    /**
     * Real allocated size of all instances. Database allocates space for th objects using quantums,
     * for example object wilth size 25 bytes will use 32 bytes in the storage. 
     * In item associated with Storage class this field contains size of all allocated
     * space in the database (marked as used in bitmap)
     */
    public long allocatedSize;

    /**
     * MemoryUsage constructor
     */
    public MemoryUsage(Class cls) { 
        this.cls = cls;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -