use kmp_malloc to release locking issue