morrySnow commented on code in PR #64776: URL: https://github.com/apache/doris/pull/64776#discussion_r3510155964
########## fe/fe-core/src/main/java/org/apache/doris/qe/TimeBasedChangeVisibleWaiter.java: ########## @@ -0,0 +1,155 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.qe; + +import org.apache.doris.analysis.TableScanParams; +import org.apache.doris.catalog.Env; +import org.apache.doris.catalog.OlapTable; +import org.apache.doris.catalog.TableIf; +import org.apache.doris.common.Pair; +import org.apache.doris.common.UserException; +import org.apache.doris.nereids.analyzer.UnboundRelation; +import org.apache.doris.nereids.trees.plans.Plan; +import org.apache.doris.nereids.util.RelationUtil; +import org.apache.doris.planner.OlapScanNode; +import org.apache.doris.transaction.TransactionState; +import org.apache.doris.transaction.TransactionStatus; +import org.apache.doris.tso.TSOTimestamp; + +import com.google.common.annotations.VisibleForTesting; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TimeBasedChangeVisibleWaiter { + private final ConnectContext context; + private final Plan plan; Review Comment: 由于plan是immutable的,所以当plan被改写后,这些对象由于没有引用,就会被释放。当plan被其他对象持有后,这些内存就无法释放。之前一个极端的例子是在profile中持有了plan的引用而没有及时释放。而profile持有的plan又引用了memo中的对象,导致fe内存紧张 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
