Skip to content

Commit 22b230e

Browse files
Replaced deprecated wmic with powershell command to get TotalPhysicalMemory
WMIC is deprecated in windows 2025,causing issues in retrieving TotalPhysicalMemory.This update switches to PowerShell-based commands for future support Related : runtimes/automation/issues/241 Signed-off-by: Amrutha Kanhirathingal <[email protected]>
1 parent aee12b4 commit 22b230e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

openjdk/openjdk.mk

+1-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ ifeq ($(OS),FreeBSD)
6262
endif
6363
ifeq ($(CYGWIN),1)
6464
NPROCS:=$(NUMBER_OF_PROCESSORS)
65-
MEMORY_SIZE:=$(shell \
66-
expr `wmic computersystem get totalphysicalmemory -value | grep = \
67-
| cut -d "=" -f 2-` / 1024 / 1024 \
68-
)
65+
MEMORY_SIZE:=$(shell powershell -command "(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1024 / 1024")
6966
endif
7067
ifeq ($(OS),SunOS)
7168
NPROCS:=$(shell psrinfo | wc -l)

0 commit comments

Comments
 (0)