One of our servers ran into this error after the shared memory zone ran out of free space.
2026/03/16 10:53:18 [alert] 3931255#3931255: ngx_slab_free(): chunk is already free in js shared zone "zone_name"
It's on NJS 0.9.5 and I know that the message that preceded it has been silenced in 0.9.6 if timeout + eviction are enabled in the zone.
2026/03/16 10:53:18 [crit] 3931255#3931255: ngx_slab_alloc() failed: no memory in js shared zone "zone_name"
Grant that the message is only an alert but it sounded like an attempt to double free memory behind the scenes and that would imply some sort of memory management bug in NJS for this so I wanted to relay this and ask.
We've only seen this occur one time now so I can't specifically name a way to reproduce this but I'd assume that you'd just have to overfill the memory zone. When this did happen, Nginx CPU use spiked to 100% and we had to restart the Nginx process to fix it.
Our memory zone definition is:
js_shared_dict_zone zone=zone_name:10m type=string timeout=30m evict;
This is an Nginx 1.29.5 build with NJS 0.9.5 on AlmaLinux 9.
We aren't using any memory clear/delete NJS functions. The code that uses this zone strictly uses get/set functions and it does sets only if the memory zone doesn't have the key/value pair set already.
If there's anything else that you'd need to know to look into this or confirm that it is resolved in 0.9.6 or otherwise, please let me know. If there's something about this setup that you'd advise doing differently, I'm happy to hear that as well.
One of our servers ran into this error after the shared memory zone ran out of free space.
2026/03/16 10:53:18 [alert] 3931255#3931255: ngx_slab_free(): chunk is already free in js shared zone "zone_name"
It's on NJS 0.9.5 and I know that the message that preceded it has been silenced in 0.9.6 if timeout + eviction are enabled in the zone.
2026/03/16 10:53:18 [crit] 3931255#3931255: ngx_slab_alloc() failed: no memory in js shared zone "zone_name"
Grant that the message is only an alert but it sounded like an attempt to double free memory behind the scenes and that would imply some sort of memory management bug in NJS for this so I wanted to relay this and ask.
We've only seen this occur one time now so I can't specifically name a way to reproduce this but I'd assume that you'd just have to overfill the memory zone. When this did happen, Nginx CPU use spiked to 100% and we had to restart the Nginx process to fix it.
Our memory zone definition is:
js_shared_dict_zone zone=zone_name:10m type=string timeout=30m evict;
This is an Nginx 1.29.5 build with NJS 0.9.5 on AlmaLinux 9.
We aren't using any memory clear/delete NJS functions. The code that uses this zone strictly uses get/set functions and it does sets only if the memory zone doesn't have the key/value pair set already.
If there's anything else that you'd need to know to look into this or confirm that it is resolved in 0.9.6 or otherwise, please let me know. If there's something about this setup that you'd advise doing differently, I'm happy to hear that as well.