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

web-server.js


var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(3000, '127.0.0.1');

console.log('Server running at http://127.0.0.1:3000/');
curl http://localhost:3000
Hello World

Input file specified two times

For some reason, this morning, I started seeing this error when I was trying to use todo

Input file specified two times

Here is the fix:

edit todo.config

export TODOTXT_SORT_COMMAND='/bin/sort -f -k2'