added heapy log of memory.
exit just before creating graph