introduce several kinds of memory optimization
support "misc32.py" test case on branch