Our application has been experiencing signs of a memory leak. We are
using 7.0 b4 of Jess. Using heap dumps we have tracked the leak to a
large number of jess/Token arrays and jess/ArrayTokenList instances
being referenced by jess/TokenTree instances.
Here are some counts from a recent test where we compared object counts
and sizes from the middle of a test run to the end of the test run
several hours later. Count is the object count, Total Size is the size
of the instances including all children, Size is the size of the object
excluding all children. All lines are reported as <value for 1st
snapshot> --> <value for 2nd snapshot> == difference.
jess/Token
Count: 890,287 --> 1,296,847 == 406,560
Total Size: 22,323,560 --> 32,081,000 == 9,757,440
Size: 21,403,416 --> 31,160,856 == 9,757,440
jess/ArrayTokenList
Count: 889,973 --> 1,296,533 == 406,560
Total Size: 71,689,208 --> 104,214,008 == 32,524,800
Size: 49,838,736 --> 72,606,096 == 22,767,360
jess/TokenTree
Count: 3927 --> 3927 == 0
Total Size: 79,186,792 --> 114,964,984 == 35,778,192
Size: 282,976 --> 282,976 == 0
A typical potion of the heap dump looks like this:
4,657,768 (1%) [208] 14 jess/Defrule 0x2a99eb87a0
4,569,416 (1%) [208] 13 jess/Defrule 0x2a99ebd820
4,505,888 (1%) [64] 2 java/util/ArrayList 0x2a99ebd9e0
4,505,824 (1%) [160] 18 array of java/lang/Object 0x2a99ed48b0
3,453,704 (1%) [80] 3 jess/Node1TEQ 0x2a99ec9308
930,104 (0%) [144] 5 jess/Node2 0x2a99ed4220
541,208 (0%) [72] 2 jess/TokenTree 0x2a99ed43f0
388,440 (0%) [72] 2 jess/TokenTree 0x2a99ed43b8
388,368 (0%) [35,328] 4,414 array of jess/MutableTokenList
0x2aa6246fc8
80 (0%) [56] 2 jess/ArrayTokenList 0x2aabd79100
80 (0%) [56] 2 jess/ArrayTokenList 0x2aae314c28
80 (0%) [56] 2 jess/ArrayTokenList 0x2aaea83760
80 (0%) [56] 2 jess/ArrayTokenList 0x2aaf86e9e8
80 (0%) [56] 2 jess/ArrayTokenList 0x2aaed55e60
80 (0%) [56] 2 jess/ArrayTokenList 0x2aab84d370
80 (0%) [56] 2 jess/ArrayTokenList 0x2ab0411388
80 (0%) [56] 2 jess/ArrayTokenList 0x2aa61b1708
80 (0%) [56] 2 jess/ArrayTokenList 0x2aa81a4900
80 (0%) [56] 2 jess/ArrayTokenList 0x2ab1b7c390
80 (0%) [56] 2 jess/ArrayTokenList 0x2aae810610
80 (0%) [56] 2 jess/ArrayTokenList 0x2ab3d3d078
80 (0%) [56] 2 jess/ArrayTokenList 0x2aa61ea170
80 (0%) [56] 2 jess/ArrayTokenList 0x2aac403bf0
80 (0%) [56] 2 jess/ArrayTokenList 0x2aa61c9d58
80 (0%) [56] 2 jess/ArrayTokenList 0x2ab77ca640
80 (0%) [56] 2 jess/ArrayTokenList 0x2aad1c35f0
80 (0%) [56] 2 jess/ArrayTokenList 0x2ab018a878
80 (0%) [56] 2 jess/ArrayTokenList 0x2ab0e811e0
80 (0%) [56] 2 jess/ArrayTokenList 0x2ab10c68e0
There are 4,394 more children
I see there are reports of a memory leak in the TokenTree but they are
reported to be fixed in a previous version, 7.0 b2. I do not see
anything in any other release notes indicating this has been fixed.
Confidentiality Notice:
**********************************************
This E-mail and any attachments thereto, are intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of this E-mail,
you are hereby notified any dissemination, distribution or copying of this
E-mail, and any attachments thereto, is strictly prohibited. If you receive
this E-mail in error, please immediately notify me by reply E-mail or telephone
at (218) 723-7887 and permanently delete the original and any copy of this
E-mail, and any printout thereof.