Sizeof问题调整第三方库

This commit is contained in:
inrgihc
2021-06-09 18:07:56 +08:00
parent a6fdb757e0
commit 9fd0230b9a
2 changed files with 6 additions and 6 deletions

View File

@@ -63,9 +63,9 @@
</dependency>
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>java-sizeof</artifactId>
<version>0.0.5</version>
<groupId>org.ehcache</groupId>
<artifactId>sizeof</artifactId>
<version>0.4.0</version>
</dependency>
<dependency>

View File

@@ -9,7 +9,7 @@
/////////////////////////////////////////////////////////////
package com.gitee.dbswitch.data.handler;
import com.carrotsearch.sizeof.RamUsageEstimator;
import org.ehcache.sizeof.SizeOf;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.common.util.CommonUtils;
import com.gitee.dbswitch.core.model.ColumnDescription;
@@ -205,7 +205,7 @@ public class MigrationHandler implements Supplier<Long> {
}
cache.add(record);
cacheBytes += RamUsageEstimator.sizeOf(record);
cacheBytes += SizeOf.newInstance().deepSizeOf(record);
++totalCount;
if (cache.size() >= BATCH_SIZE || cacheBytes >= MAX_CACHE_BYTES_SIZE) {
@@ -295,7 +295,7 @@ public class MigrationHandler implements Supplier<Long> {
countDelete++;
}
cacheBytes += RamUsageEstimator.sizeOf(record);
cacheBytes += SizeOf.newInstance().deepSizeOf(record);
totalBytes.addAndGet(cacheBytes);
countTotal++;
checkFull(fields);