Oh my god!!!
I don't know why, that memory leak problem only happens when I run the program inside NetBeans. Somehow the
IDE does not release memory immediately.
But when I run the program outside NetBeans, there seems to be no problem at all.
What a strange behavior!