Add buffer memory limit support