Another beginner's memory consumption problem...