db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Katherine Marsden <kmarsdende...@sbcglobal.net>
Subject Re: How Much Memory for hash joins
Date Fri, 01 Mar 2013 17:28:26 GMT
On 2/28/2013 9:11 AM, Mike Matrigali wrote:
> In BackingStoreHashTableFromScan I see.
>>        this.max_inmemory_rowcnt = max_inmemory_rowcnt;
>>          if( max_inmemory_rowcnt > 0)
>>              max_inmemory_size = Long.MAX_VALUE;
>>          else
>>              max_inmemory_size = Runtime.getRuntime().totalMemory()/100;

I have been reading the comments and trying to make sense of the logic 
and understand all that is happening with max_inmemory_size. I don't 
have a test case that goes through the else part of the condition above.

One thing I did notice is that Runtime.getRuntime().totalMemory() 
returns really different things if -Xms is set large, for example with  
nothing else going on with  -Xms1048m -Xmx1048m I get:

Total Memory:1098907648 Free Memory:1088915600

With just    -Xmx1048m
Total Memory:4194304 Free Memory:2750304

Two questions
1) Might hash joins use an unexpectedly large amount of memory if -Xms 
is set large?  I know at the user site where this was being set, they 
were setting -Xms in the hopes of optimizing memory usage but I wonder 
if it actually increased the amount of memory used by hash joins.
2) Is there a test case that goes through the else clause above that I 
could use for my experimentation?



View raw message