Re: runtime.parser.Parser maintains multiple VelocityCharStreams?
Christopher Schultz <[email protected]>
| Newsgroups | gmane.comp.jakarta.velocity.user |
|---|---|
| Message-ID | <[email protected]> |
Nathan, On 4/12/13 2:06 PM, Nathan Bubna wrote: > I've no idea. I've never really dug into those much. If Jarkko is > kicking around, he might know. I'll give it a few days before I give it another bump. Oh, and I totally forgot to mention that I was using Velocity 1.7. Thanks, -chris > > On Fri, Apr 12, 2013 at 10:41 AM, Christopher Schultz > <[email protected]> wrote: >> All, >> >> I've been doing some profiling looking for wasted memory in my webapp >> and I've discovered that org.apache.velocity.runtime.parser.Parser >> contains a few members that appear to be (essentially) duplicates. >> >> First, there is the "velocharstream" member which is a >> VelocityCharStream. Then, there is also a token_source member which is a >> ParserTokenManager which has a separate VelocityCharStream >> ("velcharstream" member). YourKit reports that these two are distinct >> objects, and they don't appear to share anything so I think they really >> are distinct. >> >> Each VelocityCharStream has a pair of 4096-byte buffers ("bufcolumn" and >> "bufline") plus a 8192-byte buffer in the "inputStream" member (a >> java.io.InputStreamReader), so each Parser is currently eating up 16k of >> memory in buffers. Yes, I know it's really nothing, but I'm wondering if >> buffers (or streams) are being allocated when they don't need to be >> allocated. >> >> Does anyone know why there might be two separate VelocityCharStreams at >> the Parser level? How about the 2 bufline/bufcolumn buffers in >> VelocityCharStream as well as the 8192-byte InputStreamReader buffer? >> >> The code has no inline documentation of Javadoc to suggest the purpose >> of these members. >> >> Thanks, >> -chris >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
signature.asc
(application/pgp-signature, 946 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJRaGL+AAoJEBzwKT+lPKRY7EoP/jmoCjF1XFc25vWez0003yEW pqZWZYQVXQPRSGSFZZDUkD/NVXDFdQjFH6pnal5szWDcL+tR++f3QqrDJIKPPBbm 3lMnRlFfYmD/ibeSaYaYPDBl+ASDkoCOGVlkJy6S1l1KAa6aj6E6rQbx63ZF9QAW PCJXNaDtzSMu4neGpYw+AhDUKHUWOjg8DOHuAbobvOHGQ9YH+jfBaRSX+Ks0+F9Q Qu8+XaKty+DKUsLqtJj4pHOHqzPRDqksScHYfeI3AYVMrst0JY7RwGBCaXkd05NO UNiXsEuzJ3AShYXd4hNiqAbvXC2tXvqqAjOu0vrIcv4CaK5GSS1TufAHq+8MOuqz vsNwKqQg+KFFePL4AuFzQzZtxcJcA4BkyfngFIGxOxdlqofEWbLRAeo/hsMeHwnw XmOye0dvjgwL7PqiP7hkjEUrLM5YKKwptx200yHo9th/S9fyjIMbDjBRblBjlzuG 1teneI4lPPUjUxBKeioZc7//SoZSNBylMdx5xXw9qkjjjVO6dDfqiILgt09khidk 68EQrckcV5pMbrcqmXt2xd6vwx7UpUcxxyd3ThUshqx+3tfgZJbBXFUs4MwTsQfN rFciwhkUPx5HFoT8WFy1z5m/ymc8PUVy3P4La2/e/5YB80p82JnD5yBVbDEkhbsW 2gb9ApQCWeHfRbxPsxkB =pAG5 -----END PGP SIGNATURE-----