try to reduce memory cost