support direct mem serialization