Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Seems like java is just using more <em>virtual</em> memory.</p> <pre><code>USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND amwise 20598 0.0 0.5 22052 5624 pts/3 Sl+ 14:59 0:00 mono Test.exe amwise 20601 0.0 0.7 214312 7284 pts/2 Sl+ 15:00 0:00 java Program </code></pre> <p>I made a test program in C# and in Java that print the string "test" and waits for input. I believe that the resident set size (RSS) value more accurately shows the memory usage. The virtual memory useage (VSZ) is less meaningful.</p> <p>As I understand it applications can reserve a ton of virtual memory without actually using any real memory. For example you can ask the <a href="http://msdn.microsoft.com/en-us/library/aa366887.aspx" rel="nofollow noreferrer">VirtualAlloc</a> function on Windows to either reserve or commit virtual memory.</p> <p>EDIT:</p> <p>Here is a pretty picture from my windows box: <a href="http://awise.us/images/mem.png" rel="nofollow noreferrer">alt text http://awise.us/images/mem.png</a></p> <p>Each app was a simple printf followed by a getchar. Lots of virtual memory usage by Java and CLR. The C version depends on just about nothing, so it's memory usage is tiny relatively. </p> <p>I doubt it really matters either way. Just pick whichever platform you are more familiar with and then don't write terrible, memory-wasting code. I'm sure it will work out.</p> <p>EDIT:</p> <p>This <a href="http://technet.microsoft.com/en-us/sysinternals/dd535533.aspx" rel="nofollow noreferrer">VMMap tool</a> from Microsoft might be useful in figureing out where memory is going.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload