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

Cannot allocate initial memory #105

Open
cmbbr opened this issue Nov 18, 2022 · 1 comment
Open

Cannot allocate initial memory #105

cmbbr opened this issue Nov 18, 2022 · 1 comment

Comments

@cmbbr
Copy link

cmbbr commented Nov 18, 2022

Hello,

I'm starting a project where, after some research, I would like to embed clover db. I've started to tried it but I'm getting kernel panic due to memory allocation.

I was going through past issues and I read issue #35 , so I made sure I'm using db.Close(), actually my code is just your repply to that issue:

db, err := c.Open("./db")
defer db.Close()
if err != nil {
    panic(err)
}

After which I get a kernel panic saying:

cannot allocate memory while mmapping ./db2/000001.vlog with size: 2147483646

My question is: is there a way to configure the db so it doesn't reserve so much memory from the start?

Thank you for your work.

@ostafen
Copy link
Owner

ostafen commented Nov 18, 2022

Hi, @cmbbr, there problem here is that badgerDB is very memory demanding.

Give a look at this PR: #99
In that branch, I'm integrating support for supporting both boltDB and badgerDB. Maybe using boltDB for you could be better, since it's really less memory demanding.

Let me know if you are able to use that branch and if it works for you. I'll have it merged soon

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