-
Bug
-
Resolution: Fixed
-
Normal
-
9.1.0, 8.5.1.3, 9.5.0.2
-
Security Level: Jimmy
-
None
Steps to Reproduce
ViewModel
public class MemLeakVM { private int idx = 0; private Bean bean = new Bean(idx++); @Command public void refresh() { bean = new Bean(idx++); BindUtils.postNotifyChange(null, null, this, "bean"); } public Bean getBean() { return bean; } public class Bean { private final int idx; public Bean(int idx) { this.idx = idx; } public int getIdx() { return idx; } } }
zul
<zk> <div viewModel="@id('vm') @init('MemLeakVM')"> <apply obj="@load(vm.bean)"> <label value="${obj.idx}"/> </apply> <button onClick="@command('refresh')" label="Refesh"/> </div> </zk>
1) load the page
2) take a heap dump
3) click the Refresh button
4) take a heap dump
... repeat 3,4,3,4
Current Result
then number of MemLeakVM$Bean instances increases in memory (old objects are not GCed)
Expected Result
only a single instance of MemLeakVM$Bean in memory
Debug Information
Workaround
- is blocked by
-
ZK-3808 Provide performance tuning options for meshes
- Closed