polotek/libxmljs — Issue #97: libxmljs leaks memory in parseXmlString
Author: SaltwaterC
Created: 2012-01-09 13:20:20+00:00
State: open

I can't give you anymore useful information. I can provide a script that reproduces it though.

```javascript
var http = require('http')
var libxmljs = require('libxmljs')

console.log(process.pid)

var useFeed = function () {
var req = http.get({
host: '127.0.0.1',
path: '/feed.xml'
}, function (res) {
var body = ''
res.on('data', function (data) {
body += data
})
res.on('end', function () {
var xmlDocument = libxmljs.parseXmlString(body)
useFeed()
})
})
}

useFeed()
```

This eats the memory pretty quickly. feed.xml is an arbitrary WordPress feed file (saved as static document), but I guess any document can reproduce it sooner or later.