Mercurial Eclipse

In Eclipse, if you want to add a project into Mercurial:

Team->Share Project....

I got a problem with one project, and I could not apply "Share Project" into it. The fix is: Team->Disconnect, then apply "Share Project".

Heap vs Stack vs Perm Space

Heap space: All live objects are allocated here.
Stack space: Stores references to the object for variable in method call or variable instantiation.
Perm space: Stores loaded classes information

For example:

Student std = new Student();

After executing the line above memory status will be like this.

Heap: stores "new Student()"
Stack: stores information about "std"
Perm Space: stores information about Student class

JVM config

-Xms512m -Xmx1024m -XX:PermSize=64MB -XX:MaxPermSize=512M

-Xms512m: JVM heap initial size
-Xmx1024m: JVM heap max size

----java.lang.OutOfMemory

Perm: Permanate generation
-XX:PermSize: JVM perm initial size
-XX:MaxPermSize=512ML JVM perm max size

----java.lang.OutOfMemoryError: PermGen space

chat.js


nc localhost 8000  (open in several sessions)

tcp-server.js

 var net = require('net');

 var server = net.createServer(function(socket) {
     socket.write('hello\n');
     socket.end('world\n');
  });

 server.listen(8000);
telnet localhost 8000
nc localhost 8000
hello
world