Sveta, did you confirm specifically 5.6 w/ InnoDB? If this is at all related to partitioning, 5.7 InnoDB has native partitioning implemented which is specifically done for memory utilization issues with large numbers of partitions where 5.6 InnoDB uses the same legacy partition handler that TokuDB uses in both 5.6 and 5.7.
Sveta, did you confirm specifically 5.6 w/ InnoDB? If this is at all related to partitioning, 5.7 InnoDB has native partitioning implemented which is specifically done for memory utilization issues with large numbers of partitions where 5.6 InnoDB uses the same legacy partition handler that TokuDB uses in both 5.6 and 5.7.