From Documentation

Jump to: navigation, search




  • Author
    Sam Chuang, Engineer, Potix Corporation
  • Date
    August 25, 2010
  • Version
    ZK 5.0.4 and above

Contents

Preface

ZK 5.0.4 optimized the memory usage further at the server side (detail). This smalltalk walks through the results of testing individual components and our ZK Demo, now referred to as the ZK Sandbox.

Server Environment

Hardware

  • CPU: AMD Athlon(tm) 64 Processor 3800+ 2.40 GHz
  • Memory (RAM): 3.00 GB
  • Network Adapter: Broadcom 440x 10/100 Integrated Controller

Software

  • Window 7
  • JDK 1.6.0-16 32 Bit
  • Apache Tomcat Server 6.0.20
  • ZK Demo
  • ZK 5.0.4 versus ZK 5.0.3
  • java.SizeOf

Test plan

We use sizeof.jar to measure the component memory usage. First of all we measure the memory use of individual components and then measure the total memory used by the sample application, ZK Demo.


In this test, we do not measure the objects that a component might reference. For example, we don't include the memory taken by the String object, This is a long string, in this report.

<label label="This is a long string"/>

Test Result

Memory Usage of Individual Components

At first, we measure the memory use of individual components. Here we test the popular components, such as window, label, listbox and so on.

Component-memory.png
Component ZK 5.0.3 (byte) ZK 5.0.4 (byte) Memory Saved (%)
Window 248 112 55%
Label 213 72 66%
Listbox 336 200 40%
Grid 288 152 47%
Tree 272 136 50%
Vbox/Hbox 216 80 63%
VLayout/HLayout n/a 64 n/a

Memory Usage of a Sample Application: ZK Sandbox

Here is the measure of a sample application, ZK Sandbox (old ZK Demo).

Zkdemo-memory.png
ZK Demo ZK 5.0.3 (KB) ZK 5.0.4 (KB) Memory Saved (%)
index.zul 16.437 6.078 63%

Summary

As demonstrated, the memory usage has reduced between 40% and 70% depending on the component tested. This combines for a grand total of 63% memory saving on our ZK Sandbox’s index page just by upgrading the ZK version to 5.0.4.

Comments



Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.
You got stuck here?
Let us know why!
For questions please use the forum