Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clear consumed items in order to reduce data on disk ? #38

Open
yanggeorge opened this issue Aug 13, 2020 · 1 comment
Open

Comments

@yanggeorge
Copy link

I create a bigqueue, and enqueue many items, then dequeue all.
But the size of bigqueue on disk will become bigger and bigger.

        String queueDir = "/Users/ym/data/bigqueue";
        String queueName = "demo";
        IBigQueue bigQueue = null;
        try {
            bigQueue = new BigQueueImpl(queueDir, queueName);


            for (int i = 0; i < 1000000; i++) {
                String item = String.valueOf(i);
                bigQueue.enqueue(item.getBytes());
            }

            // dequeue some items
            for (int i = 0; i < 1000000; i++) {
                String item = new String(bigQueue.dequeue());
                System.out.println(item);
            }
        } finally {
            bigQueue.close();
        }

How to release space or reduce file ?

I have tried IBigQueue.gc() , but not working .
IBigQueue.removeAll() will reduce the file, but I only want to clear consumed items.

@yanggeorge yanggeorge changed the title How to release space ? How to clear consumed items in order to reduce data on disk ? Aug 13, 2020
@nitishgoyal13
Copy link

@yanggeorge Which version of Java are you using? If you are using Java 11, it might be happening because of the issue mentioned here [https://github.com//issues/39]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants