title: Running Java remotely using PowerShell
body: <p>When I run <a href="http://en.wikipedia.org/wiki/Windows_PowerShell" rel="nofollow">PowerShell</a> in a remote session (<code>etsn {servername}</code>), I sometimes can't seem to run Java processes, even the most simple:</p>
  
  <pre><code>[chi-queuing]: PS C:\temp&gt; java -cp .\hello.jar Hello
  Error occurred during initialization of VM
  Could not reserve enough space for object heap
  </code></pre>
  
  <p><code>Hello.jar</code> is an "Hello, world!" application that should just print "Hello" to <a href="http://en.wikipedia.org/wiki/Standard_streams#Standard_output_.28stdout.29" rel="nofollow">standard output</a>.</p>
  
  <p>So, the question is, is there something special about running processes on the other side of a PowerShell session? Is there something special about how the Java VM works that might not allow treatment like this? The memory is allocated on the remote computer, right? Here is a readout on the physical memory available:</p>
  
  <pre><code>[chi-queuing]: PS C:\temp&gt; $mem = Get-wmiobject -class Win32_OperatingSystem
  [chi-queuing]: PS C:\temp&gt; $mem.FreePhysicalMemory
  1013000
  </code></pre>
  
  <p>But, when I remote desktop to the server and ask the OS how much free memory there is, it says 270&nbsp;MB physical memory free. Let me know what you think!</p>