profesorfalken / jPowerShell

Simple Java API to interact with PowerShell console
Apache License 2.0
218 stars 84 forks source link

ProcessBuilder memory leak and memoy lock issues #80

Open SivaBalaSubramanian-Vetrivel opened 3 years ago

SivaBalaSubramanian-Vetrivel commented 3 years ago

Hi All

The code below uses PowerBuilder to execute  power shell. Just want to confirm the chances of memory leak and memory lock. As per this link https://bugs.openjdk.java.net/browse/JDK-8054841 memory leak got fixed, however do we have any details on memory lock. I would appreciate if some one share  any workaround, fix

if (OSDetector.isWindows()) { pb = new ProcessBuilder("cmd.exe", "/c", "chcp", codePage, ">", "NUL", "&", powerShellExecutablePath, "-ExecutionPolicy", "Bypass", "-NoExit", "-NoProfile", "-Command", "-"); } else { pb = new ProcessBuilder(powerShellExecutablePath, "-nologo", "-noexit", "-Command", "-"); }