{"id":1739,"date":"2016-09-23T14:23:03","date_gmt":"2016-09-23T14:23:03","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=1739"},"modified":"2016-09-23T14:23:03","modified_gmt":"2016-09-23T14:23:03","slug":"when-to-use-jsp-page-session-false-directive","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/when-to-use-jsp-page-session-false-directive\/","title":{"rendered":"When to use JSP page session = \u201cfalse\u201d directive?"},"content":{"rendered":"<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n &lt;%@ page session=&quot;false&quot; %&gt;\r\n<\/pre>\n<p>One reason would be performance and memory. If you have a page that doesn&#8217;t need to be involved in a session (like say, an about.jsp or faq.jsp) then the default behaviour of involving every JSP in a session will impose the overhead of creating a new session object (if one doesn&#8217;t already exist) and increased memory usage as more objects reside on the heap.<\/p>\n<p>This effect will be greatly exaggerated in case of a single page seeing high traffic from many unique users combined with a high bounce rate i.e. they users do not continue to browse but leave the site immediately after viewing that one page- the container will create a new session object per user which will never be used again and will ultimately be garbage collected after it times out &#8211; added over head of object creation, memory usage and garbage collection without giving you any real value.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;%@ page session=&quot;false&quot; %&gt; One reason would be performance and memory. If you have a page that doesn&#8217;t need to be involved in a session (like say, an about.jsp or faq.jsp) then the default behaviour of involving every JSP in a session will impose the overhead of creating a new session object (if one doesn&#8217;t&hellip; <a href=\"https:\/\/codethataint.com\/blog\/when-to-use-jsp-page-session-false-directive\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-1739","post","type-post","status-publish","format-standard","hentry","category-jsp"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=1739"}],"version-history":[{"count":1,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1739\/revisions"}],"predecessor-version":[{"id":1740,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1739\/revisions\/1740"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=1739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=1739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=1739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}