add global tracing ability, fix compile error when CHECK_MEMORY not set
WIP map impl refactor for memory releasing