-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Named Query Excessive Memory usage in HqlLexer
PostPosted: Wed May 11, 2011 8:59 am 
Newbie

Joined: Tue May 10, 2011 4:40 pm
Posts: 1
I found something interesting while profiling our application that I'm hoping someone can explain. I noticed 8.3 MB of memory allocated to int16[] arrays. Digging down further I found that these all originated in NHibernate.Hql.Ast.ANTLR.HqlLexer for static readonly field DFA23_transition. Here is the variable definition

static readonly short[][] DFA23_transition = DFA.UnpackEncodedStringArray(DFA23_transitionS);

When setting a breakpoint on this the arrays first dimension is 346 and the second dimension varies between 0 - 65526

Total memory usage for the array ends up being around 8.3 meg. I then started looking at what causes this class to be used and narrowed it down to a named queries. We only have one named query defined in our hbm.xml files and if I remove that then I do not see this class get used.

Can anyone explain what this is doing and why its using so much memory. Our application is a web application and we have hundreds of instances running. 8.3mb doesn't seem like much but it adds up quick with that many instances.


Top
 Profile  
 
 Post subject: Re: Named Query Excessive Memory usage in HqlLexer
PostPosted: Thu May 26, 2011 10:43 am 
Newbie

Joined: Wed Jan 21, 2004 5:12 pm
Posts: 8
I'm seeing the same issue with named queries in the mapping files.

Have you figured out a resolution other than removing the named queries?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.