From 9fd0230b9ac480e0dd6933d88ac7e5fa5182f518 Mon Sep 17 00:00:00 2001 From: inrgihc Date: Wed, 9 Jun 2021 18:07:56 +0800 Subject: [PATCH] =?UTF-8?q?Sizeof=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbswitch-data/pom.xml | 6 +++--- .../com/gitee/dbswitch/data/handler/MigrationHandler.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dbswitch-data/pom.xml b/dbswitch-data/pom.xml index 8a7ca69f..40d7edd8 100644 --- a/dbswitch-data/pom.xml +++ b/dbswitch-data/pom.xml @@ -63,9 +63,9 @@ - com.carrotsearch - java-sizeof - 0.0.5 + org.ehcache + sizeof + 0.4.0 diff --git a/dbswitch-data/src/main/java/com/gitee/dbswitch/data/handler/MigrationHandler.java b/dbswitch-data/src/main/java/com/gitee/dbswitch/data/handler/MigrationHandler.java index b4df05e4..def73c77 100644 --- a/dbswitch-data/src/main/java/com/gitee/dbswitch/data/handler/MigrationHandler.java +++ b/dbswitch-data/src/main/java/com/gitee/dbswitch/data/handler/MigrationHandler.java @@ -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 { } 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 { countDelete++; } - cacheBytes += RamUsageEstimator.sizeOf(record); + cacheBytes += SizeOf.newInstance().deepSizeOf(record); totalBytes.addAndGet(cacheBytes); countTotal++; checkFull(fields);