Memory growth issue about crypto module.
- Version: v6.9.4 & v8.1.2
- Platform: Linux 3.10.0-514.21.2.el7.x86_64 deps: update openssl to 1.0.1j #1 SMP Tue Jun 20 12:24:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
If I run cipher related function many times, I can see memory growth even though execute gc manually.
To be more specific, if I use cipher.final(), it causes memory growth.
Below is test code.
var crypto = require('crypto'); function testCipher() { var cipher = crypto.createCipheriv('aes-128-gcm', Buffer.from('1234567890123456'), Buffer.from('a1')); cipher.setAutoPadding(false); return Buffer.concat([cipher.update(Buffer.from('datas')), cipher.final()]); } for (var i = 0; i < 100000000; i++) { testCipher(); if (i % 200000 === 0) { gc(true); } }