diff options
| author | Fuwn <[email protected]> | 2026-02-13 02:05:49 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-13 02:05:49 -0800 |
| commit | 9817c9b1647faaa1ffe4af5a7620a8602651f438 (patch) | |
| tree | ff22dd2e017565aadc146062f0c7064e74035df2 /NET/worlds/console/StatMemNode.java | |
| parent | fix: Decompilation artifact repairs for Java 11 compilation (diff) | |
| download | worldsplayer-9817c9b1647faaa1ffe4af5a7620a8602651f438.tar.xz worldsplayer-9817c9b1647faaa1ffe4af5a7620a8602651f438.zip | |
feat: Reimplement core I/O and system information native methods with pure Java
- FastDataInput: DataInputStream wrapper replacing native binary I/O
- DNSLookup: InetAddress.getAllByName() replacing native gethostbyname()
- Restorer: Array.newInstance() replacing native makeArray()
- SystemInfo: Runtime/File APIs for disk, memory, CPU, platform info
- StatMemNode: Runtime APIs for memory status reporting
Diffstat (limited to 'NET/worlds/console/StatMemNode.java')
| -rw-r--r-- | NET/worlds/console/StatMemNode.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/NET/worlds/console/StatMemNode.java b/NET/worlds/console/StatMemNode.java index 1e3fc21..b5031dd 100644 --- a/NET/worlds/console/StatMemNode.java +++ b/NET/worlds/console/StatMemNode.java @@ -34,7 +34,8 @@ public class StatMemNode extends StatMan implements MainCallback { StatisticsRoot.getNode().addChild(this); } - public static native void nativeInit(); + public static void nativeInit() { + } @Override public String toString() { @@ -101,5 +102,12 @@ public class StatMemNode extends StatMan implements MainCallback { this._grabbedList.replaceItem("Available Virtual Memory: " + this._availPageMem + " bytes", 8); } - public native void updateMemoryStatus(); + public void updateMemoryStatus() { + Runtime runtime = Runtime.getRuntime(); + + this._totPhysMem = (int)runtime.maxMemory(); + this._availPhysMem = (int)runtime.freeMemory(); + this._totPageMem = (int)runtime.totalMemory(); + this._availPageMem = (int)(runtime.maxMemory() - (runtime.totalMemory() - runtime.freeMemory())); + } } |