mirror of
https://gitee.com/dromara/dbswitch.git
synced 2025-09-27 22:21:34 +00:00
Sizeof问题调整第三方库
This commit is contained in:
@@ -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>
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user