I came into this issus in online system and find some reference in 《HBase: The Definitive Guide》.
It writes "Scanner Leases
Make sure you release a scanner instance as timely as possible. An open scanner holds quite a few resources on the server side, which could accumulate to a large amount of heap space occupied. When you are done with the current scan call close(), and consider adding this into a try/finally construct to ensure it is called, even if there are exceptions or errors during the iterations.
Like row locks, scanners are protected against stray clients blocking resources for too long, using the same lease based mechanisms. You need to set the same configuration property to modify the timeout threshold (in milliseconds):
You need to make sure that the property is set to an appropriate value that make sense for locks and the scanner leases.
But I find 'hbase.regionserver.lease.period' don't work well and Our RS hold high memory for a much longer time more than 'hbase.regionserver.lease.period' .After I add 'rs.close()' in my code,it disappeared