title: Memory is not released after a dofile in lua
body: <p>I am new to lua and was working on NodeMCU. I was trying to extract data from an xml file.</p>
  
  <p>Here is my xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;netconfig&gt;
  &lt;mode&gt;0&lt;/mode&gt;
  &lt;stamac&gt;18-FE-34-A4-4B-05&lt;/stamac&gt;
  &lt;staip&gt;XXX.XXX.XXX.XXX&lt;/staip&gt;
  &lt;stanetmask&gt;XXX.XXX.XXX.XXX&lt;/stanetmask&gt;
  &lt;stagateway&gt;XXX.XXX.XXX.XXX&lt;/stagateway&gt;
  &lt;apmac&gt;1A-FE-34-A4-4B-05&lt;/apmac&gt;
  &lt;apip&gt;192.168.4.1&lt;/apip&gt;
  &lt;apnetmask&gt;255.255.255.0&lt;/apnetmask&gt;
  &lt;apgateway&gt;192.168.4.1&lt;/apgateway&gt;
  &lt;port&gt;80&lt;/port&gt;
  &lt;dns&gt;XXX.XXX.XXX.XXX&lt;/dns&gt;
  &lt;dhcp&gt;1&lt;/dhcp&gt;
  &lt;stacustomconfig&gt;&lt;/stacustomconfig&gt;
  &lt;timezone&gt;10&lt;/timezone&gt;
  &lt;serial&gt;0x00000001&lt;/serial&gt;
  &lt;connssid&gt;ESP-10767109&lt;/connssid&gt;
  &lt;ssid&gt;&lt;/ssid&gt;
  &lt;passwd&gt;&lt;/passwd&gt;
  &lt;hostname&gt;ESP-10767109&lt;/hostname&gt;
  &lt;reboot&gt;&lt;/reboot&gt;
  &lt;message&gt;&lt;/message&gt;
  &lt;/netconfig&gt;
  </code></pre>
  
  <p>Here is my xmlparser:</p>
  
  <pre><code>return function (xmlfile, xmlword)
      file.open(xmlfile,"r")
      local eofflag = 0
      local i, j, k, l, xmloutput
      while(eofflag &lt; 1) do
          local m = file.readline()
          if(m == nil) then
              eofflag = eofflag + 1
          elseif (string.find(m, xmlword) ~= nil) then
              i, j = string.find(m, xmlword, 1)
              i = i - 1
              j = j + 2
              k, l = string.find(m, xmlword, j)
              k = k - 3
              l = l + 1
              xmloutput = string.sub(m, j, k)
              eoffile = 1
          end
      end
      file.close()
      return xmloutput
  end
  </code></pre>
  
  <p>I call this file by using:</p>
  
  <pre><code>local port = dofile("xmlparser.lc")("netconfig.xml", "port")
  </code></pre>
  
  <p>But I always endup with memory less than I started with even though I call the garbagecollector. Moreover The heap seems to decrease further if the word I am searching for is near the end of file. I also observed that if the word I am looking for is not present, the heap has the less difference I started with.</p>
  
  <p>Am I missing something?
  and thanks for taking a look.</p>