Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-92844

All layouts are gotten even when only a few of them are showed


    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 7.0.X, 7.1.X, Master
    • Fix Version/s: None
    • Component/s: Performance
    • Fix Priority:


      All layouts are gotten from database or cache even when only a few of them will be shown. This behavior was detected after user login, when layout tree is rendered.

      Master: LayoutsTreeImpl.java#L333-L335 and LayoutListUtil.java#L90-L91
      7.1.x: LayoutsTreeImpl.java#L333-L335 and LayoutListUtil.java#L90-L91
      7.0.x: LayoutsTreeImpl.java#L335-L337 and LayoutListUtil.java#L90-L91

      Steps to reproduce

      1. Start a new tomcat bundle.
      2. Use jvisualvm (include with jdk) to monitor tomcat process.
      3. You could create a new Liferay Theme that remove breadcrumb portlet and navigation portlet. In this way, you could review that all layouts are cached for layout tree in site menu (I attached new-70-theme.war for 7.0.x an d new-71-theme.war for 7.1.x). Create and configure one page with this Liferay Theme. This step is not necessary in master.
      4. Go to Control Panel > Configuration > Server Administration > (tab) Script and execute attached script addTestLayouts.groovy, but first configure next variable with site groupId where 1000 pages will be created:
         long groupId = -1L;
      1. Got to created page in step 3.
      2. Go to jvisualvm > MBeans > CacheStatistics > MULTI_VM_PORTAL_CACHE_MANAGER > com.liferay.portal.kernel.dao.orm.EntityCache.com.liferay.portal.model.impl.LayoutImpl. Review MemoryStoreObjectCount and ObjectCount.

      Expected behavior
      MemoryStoreObjectCount and ObjectCount have values around default layouts showed in site menu navigation tree (By default 20).

      Current behavior
      MemoryStoreObjectCount and ObjectCount have values around 1000 (visualvm_LayoutImpl_cache_objects.png ).



        1. addTestLayouts.groovy
          2 kB
        2. new-70-theme.war
          2.59 MB
        3. new-71-theme.war
          3.77 MB
        4. visualvm_LayoutImpl_cache_objects.png
          215 kB

          Issue Links



              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  41 weeks ago


                  Version Package