title: docker container keep increasing memory usage when writing into a file in a mounted directory
body: <p>I'm facing an issue that memory used by a container keep increasing when an app inside the container writing log into a file in a mounted directory.</p>
  
  <p>I'd expect memory usage doesn't increase by this.
  Does anyone have idea why it increases ?
  Thank you !!</p>
  
  <p>Here is what I did:</p>
  
  <ol>
  <li><p>Write an app which just writes "hello world" into "/home/mylog/test.txt".</p>
  
  <pre><code>func main(){
  file, _ := os.OpenFile("/home/mylog/test.txt", os.O_WRONLY|os.O_CREATE, 0666)
  defer file.Close()
  for {
      fmt.Fprintln(file, "hello world")
      }
  }
  </code></pre></li>
  <li><p>Build a docker image</p></li>
  </ol>
  
  <pre>
  
      docker build -t mylog .
  
  </pre>
  
  <p>Dockerfile</p>
  
  <pre>
  
      FROM golang
      RUN mkdir -p /home/mylog
      COPY main.go /go
      WORKDIR /go
      CMD ["go","run","main.go"]
  
  </pre>
  
  <ol start="3">
  <li>Run a container with -v option mouting the current dir.</li>
  </ol>
  
  <pre>
  
      docker run -d -v $PWD:/home/mylog mylog 
  
  </pre>
  
  <ol start="4">
  <li>Check memory usage</li>
  </ol>
  
  <pre>
  
      docker stats 
  
  </pre>
  
  <ol start="5">
  <li>It's using 527MiB.</li>
  </ol>
  
  <pre>
      CONTAINER CPU% MEMUSAGE / LIMIT MEM% NET I/O BLOCK I/O PIDS 
       100.41% 527MiB / 15.5GiB 3.32% 648B /0B 72.3MB / 0B 15
  </pre>
  
  <ol start="6">
  <li>After a few seconds, it is 844.8 MiB</li>
  </ol>
  
  <pre>
  
      CONTAINER CPU% MEMUSAGE / LIMIT MEM% NET I/O BLOCK I/O PIDS
       100.15% 844.8MiB / 15.5GiB 5.32% 648B /0B 72.3MB / 0B 15
  
  </pre>
  
  <ol start="7">
  <li>It keeps increasing and the host downs in the end.</li>
  </ol>