diff --git a/lib/parser.js b/lib/parser.js
index <HASH>..<HASH> 100644
--- a/lib/parser.js
+++ b/lib/parser.js
@@ -317,8 +317,14 @@ function decreaseBufferPool () {
   if (bufferPool.length > 50 * 1024) {
     // Balance between increasing and decreasing the bufferPool
     if (counter === 1 || notDecreased > counter * 2) {
-      // Decrease the bufferPool by 16kb by removing the first 16kb of the current pool
-      bufferPool = bufferPool.slice(Math.floor(bufferPool.length / 10), bufferPool.length)
+      // Decrease the bufferPool by 10% by removing the first 10% of the current pool
+      var sliceLength = Math.floor(bufferPool.length / 10)
+      if (bufferOffset <= sliceLength) {
+        bufferOffset = 0
+      } else {
+        bufferOffset -= sliceLength
+      }
+      bufferPool = bufferPool.slice(sliceLength, bufferPool.length)
     } else {
       notDecreased++
       counter--
Decrease the buffer offset if the buffer pool is shrunk