Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 225628 - Optimize state of XML lexer
Optimize state of XML lexer
Product: xml
Classification: Unclassified
Component: Lexer
PC Linux
: P3 (vote)
: 7.4
Assigned To: Svata Dedic
Depends on:
Blocks: 223953
  Show dependency treegraph
Reported: 2013-02-01 11:10 UTC by Svata Dedic
Modified: 2013-05-02 14:13 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2013-02-01 11:10:30 UTC
The XML lexer uses a bitfield Integer as its state. Since bits are shifted e.g. 24bits, the Integer.valueOf() will not cache the values, and in large documents, an Integer is allocated for each token.
If the bits are used more reasonably (e.g. consider to merge subState and prevState ?), there could be a table of all possible states pre-filled (e.g. 2500 x Integer max ?).

See defect #223953, in a 15M document, number of Integers is 1,9M and their allocated size alone about 23Mbytes.
Comment 1 Svata Dedic 2013-04-29 09:34:35 UTC
implemented in
Comment 2 Quality Engineering 2013-05-02 14:13:54 UTC
Integrated into 'main-golden', will be available in build *201305021042* on (upload may still be in progress)
User: Svata Dedic <>
Log: #225628: Lexer states reduced so they fit into byte

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo