From 9817c9b1647faaa1ffe4af5a7620a8602651f438 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 13 Feb 2026 02:05:49 -0800 Subject: 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 --- NET/worlds/console/StatMemNode.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'NET/worlds/console/StatMemNode.java') 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())); + } } -- cgit v1.2.3