copied from multi_jvm for perf comparing