New functions nmem_init/nmem_exit to init/close NMEM system.