当我在远程会话()中运行PowerShell时etsn {servername},我有时似乎无法运行Java进程,即使是最简单的:
[chi-queuing]: PS C:\temp> java -cp .\hello.jar Hello
Error occurred during initialization of VM
Could not reserve enough space for object heap
Run Code Online (Sandbox Code Playgroud)
Hello.jar是一个"你好,世界!" 应该只打印"Hello"到标准输出的应用程序.
所以,问题是,在PowerShell会话的另一端运行进程有什么特别之处吗?关于Java VM如何工作可能不允许这样的处理吗?内存是在远程计算机上分配的,对吧?以下是可用物理内存的读数:
[chi-queuing]: PS C:\temp> $mem = Get-wmiobject -class Win32_OperatingSystem
[chi-queuing]: PS C:\temp> $mem.FreePhysicalMemory
1013000
Run Code Online (Sandbox Code Playgroud)
但是,当我远程桌面到服务器并询问操作系统有多少可用内存时,它说270 MB物理内存可用.让我知道你的想法!