This repository was archived by the owner on Jan 9, 2025. It is now read-only.

Description
Environment Details
- MicroStream Version: 08.01.01-MS-GA
- JDK version: 17
- OS: linux
Describe the bug
When I reset and store the application root, after calling issueFullFileCheck() the old inaccessible data seems to be still in the storage (judging from the size).
To Reproduce
public class App {
public static void main(String[] args) throws IOException {
Path storagePath = Files.createTempDirectory("microstream");
final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storagePath);
for (int i = 0; i < 50; i++) {
storageManager.setRoot(new byte[1000000]); // 1 MB
storageManager.storeRoot();
}
storageManager.issueFullFileCheck();
storageManager.shutdown();
System.out.println("Storage size " + getSize(storagePath)); // Expected ~1 MB, actual ~50 MB
}
public static long getSize(Path dir) throws IOException {
return Files.walk(dir).map(Path::toFile).filter(File::isFile).mapToLong(File::length).sum();
}
}
Expected behavior
The storage is shrinked to only contain the current root.
Additional context
I observe the same behaviour when I wrap my byte array into a root object, and repeatedly re-initialize the array and call storeRoot().
class Root {
public byte[] data;
}