Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101497

Consider possibility to reduce TableView/TableRow footprint

XMLWordPrintable

      NodeMemory.TableViews performance test run with enabled rendering and 64mb of heap able to create only 28 tables.
      Each table is pretty small, 5 columns and 10 rows. The data type is simple class with 5 String fields
      (similar to Person).

      How to run the test:
      > cd tests/performance/NodeMemory
      > ant
      > java -Xmx64m -cp "rt/lib/jfxrt.jar;NodeMemory.jar" nodememory.TableViewsTest -render true -allocCnt 1

      add "-sleep true" in case you want to pause the process after free memory limit is reached.



      It seems to be the main cause is actually related to TableRow objects and associated with them objects.

      I did more experiments and in particular run TableView test
      (which creates one TableView with a lot of data) with big Scene height equal to 9600.
      If test is run with 24mb then it fails by reaching free memory threshold on first iteration after
      adding just one row of data.
      The reason is because in this case we create 400 TableRow objects
      (comparing to 25 in case of Scene height equal 600).
      This leads to 2000 of TableCellSkin and other table cell related objects.

      Note that overall number of TableRow objects in this test is the same as in the test where
      we are trying to create new TableView object on each iteration.
      So, the reason why we are able to create only small number of TableView objects is the same
      as for this artificial test.

      The results of running TableViews (creates tables of size 5x10) test for different heap sizes are:
        -Xmx64m 28 tables
        -Xmx96m 42 tables
       -Xmx128m 57 tables
       -Xmx256m 116 tables

            jgiles Jonathan Giles
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: