fix a statistics issue in proxy mode
add memory() api