Stack / heap memory usage study