Skip to content

Commit

Permalink
have a try
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriCoder committed Feb 4, 2025
1 parent 9f974e9 commit f1d3e35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ private InstanceHolder() {}
}

public synchronized void applyTemporaryMemoryForFlushing(long estimatedTemporaryMemSize) {
if (memtableMemoryBlock.allocate(estimatedTemporaryMemSize)) {
if (!memtableMemoryBlock.allocate(estimatedTemporaryMemSize)) {
logger.error(
String.format(
"Failed to allocate %d bytes memory for flush, "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@

import org.apache.iotdb.commons.utils.TestOnly;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReentrantLock;

public abstract class IMemoryBlock implements AutoCloseable {
private static final Logger LOGGER = LoggerFactory.getLogger(MemoryBlock.class);

/** The memory manager that manages this memory block */
protected MemoryManager memoryManager;

Expand Down Expand Up @@ -90,6 +95,7 @@ public long getMaxMemorySizeInByte() {

/** Get the memory usage in byte of this memory block */
public long getMemoryUsageInBytes() {
LOGGER.error(this.toString());
return memoryUsageInBytes.get();
}

Expand Down

0 comments on commit f1d3e35

Please sign in to comment.