glassfish 서버에서 실행되는 웹 페이지가 있습니다. 우리의 jsp 파일에는 아래와 같은 내용물이 많이 있습니다.jsp 파일에 많은 jspf 파일을 포함하면 메모리 사용량이 높습니다.
<jsp:directive.include file="johndoe/foobar.jspf"/>
이러한 파일은 사용자 선택에 따라 포함됩니다. 우리의 JSP 파일은 다음과 같이 기본적으로 :
<jsp:root version="2.1" xmlns:c="http://java.sun.com/jstl/core_rt"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
//some unimportant codes here
<c:if test="${sessionScope.loadAvgTest}">
//some unimportant codes here
<f:subview id="reports15">
<jsp:directive.include file="siforms/sysinfoform.jspf"/>
</f:subview>
//some unimportant codes here
<f:subview id="reports16">
<jsp:directive.include file="siforms/sysinfoformscheduled.jspf"/>
</f:subview>
//some unimportant codes here
</c:if>
//some unimportant codes here
<c:if test="${sessionScope.bandwidthTest}">
//some unimportant codes here
<f:subview id="reports17">
<jsp:directive.include file="mailforms/mailfilter.jspf"/>
</f:subview>
//some unimportant codes here
<f:subview id="reports18">
<jsp:directive.include file="mailforms/mailfilterscheduled.jspf"/>
</f:subview>
//some unimportant codes here
</c:if>
....
약이있다 (80)의 경우이 같은 문장이 inculdes를 포함하는 각 하나. 이러한 if 절을 많이 삭제하고 몇 가지만 삭제 한 경우 몇 가지를 포함하면 메모리 사용량이 좋았습니다. 하지만 if 절을 많이 사용하면 더 많은 메모리가 포함됩니다. 어떤 아이디어를 어떻게 코드를 최적화 할 수 있습니까? 또는 서블릿 구성을 어떻게 변경하여 메모리 사용량을 줄일 수 있습니까?