Fixing memory calculate in agent.vm