Skip to content

Consider Nashorn ScriptEngine instance scope in ScriptTemplateView [SPR-13487] #18065

@spring-projects-issues

Description

@spring-projects-issues

chanwook park opened SPR-13487 and commented

Spring MVC mechanism is create one instance for View (View = URL).
And ScriptViewTemplate has one Nashorn's ScriptEngine (SpringTemplateView#engine), or more ScriptEngine instances because using ThreadLocal (ScriptTemplateView#engineHolder).
For example, app has 1000 view(URL), then create 1000 ScriptTemplateView instance and at the same time create 1000 Nashorn’s ScriptEngine instance(or more +). And one ScriptEngine is loaded only one template HTML.

In my case, I have been used like that caused memory consumption. (I've been used JDK6+Rhino+Dust)

I hope to more careful managing view instance and Nashorn's ScriptEngine instance.
Maybe not consider share and DI to SpringEngine instance?
Of course, aspect of concurrency and resource management.

Thanks.


Affects: 4.2.2

Issue Links:

Referenced from: commits c7fd4cc, cffad9d

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions