Skip to content

Commit

Permalink
Modules: removed extra VMs creation when it is not needed.
Browse files Browse the repository at this point in the history
Previously, a new VM instance was created for every location. This is
not needed and consumes a lot of memory for large configurations.
Instead, if no new js_import is introduced on the location level server
level VM should be used.

The issue was introduced in 9b67441 (0.8.6).

This fixes #795 issue on Github.
  • Loading branch information
xeioex committed Oct 14, 2024
1 parent 6902aaa commit 685b64f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nginx/ngx_js.c
Original file line number Diff line number Diff line change
Expand Up @@ -3360,7 +3360,7 @@ ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf,
ngx_js_named_path_t *import, *pi, *pij, *preload;

if (conf->imports == NGX_CONF_UNSET_PTR
&& conf->type == NGX_CONF_UNSET_UINT
&& conf->type == prev->type
&& conf->paths == NGX_CONF_UNSET_PTR
&& conf->preload_objects == NGX_CONF_UNSET_PTR)
{
Expand Down

0 comments on commit 685b64f

Please sign in to comment.