File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1010function bytes = ram_total()
1111
1212% .NET is about 10 times SLOWER than Java
13- % if ispc() && ~stdlib.isoctave ()
14- % h = NET.addAssembly('Microsoft.VisualBasic');
15- % ci = Microsoft.VisualBasic.Devices.ComputerInfo();
16- % bytes = ci.TotalPhysicalMemory;
17- % delete(h);
18- % else
13+ if ispc() && ~stdlib .has_java ()
14+ h = NET .addAssembly(' Microsoft.VisualBasic' );
15+ ci = Microsoft .VisualBasic .Devices .ComputerInfo();
16+ bytes = ci .TotalPhysicalMemory ;
17+ delete(h );
18+ else
1919 b = javaOSBean();
2020
2121 if stdlib .java_api() < 14
2424 bytes = b .getTotalMemorySize();
2525 end
2626 bytes = uint64(bytes );
27- % end
27+ end
2828
2929% https://docs.oracle.com/en/java/javase/21/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getTotalMemorySize()
3030
You can’t perform that action at this time.
0 commit comments