level-party leader process holding memory
See original GitHub issueenv
- OS: ubuntu 20.04
- node: v16.13.1
- level-party: v5.1.1
- leveldown options: none
problem
Our level-party leader process holds up to 3GB of RAM, and refuses to release it once the activity peak passes, before being eventually killed by Linux OOM Killer (See https://github.com/inventaire/inventaire/issues/542)
It’s actually probably not a level-party-specific issue, as trying to run with only level produces the same behavior, but I didn’t know where to post: would that be a leveldown issue? Is that an expected amount of RAM for leveldb with the default options? Any clue on what we can try to address this?
Thanks for any help, I’m running short of ideas ^^’
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
AP Government Chapter 9 Notes: Political Parties
A political party might be formally defined as a group of political activists who organize to win elections, to operate the government, and...
Read more >Proficiency Levels for Leadership Competencies - OPM
accurate information to reduce conflict or concern within workplace. • Takes action to address employee grievances. U.S. Office of Personnel Management. 7. Page ......
Read more >There are three main reasons a coalition is formed:
This document outlines some of the best practices of successful political coalitions and sets forth issues which political parties and other organizations ...
Read more >Party members and leadership styles in new European ...
The determinants of leadership style assessment differ greatly across political parties. Introduction. Party leaders are of great importance to politics and to ...
Read more >The role of politicians and political parties in combating racism ...
Politicians and political parties should protect against racism, racial discrimination, xenophobia and related intolerance by enacting laws and creating ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Glad to hear you found the issue, congrats!
Sort of, yes. It depends on the encoding. In this case the key goes through the
utf8encoding which just doesString(key).In general, encodings don’t validate input, in order to be fast and forgiving. They massage user input into a desired type. For example,
db.get(Buffer.from('3'))anddb.get(3)anddb.get('3')all do the same thing. I’m not sure to what extent that’s by design (historically) but it’s fitting for JavaScript.You could opt-in to stricter type checking by using TypeScript.
Encodings are applied before
_serializeKey()so at that point your array key has already been converted to a string. Side note: the_serializeKeymethod no longer exists inabstract-level.I’m delighted to announce that this issue seems solved 😅
I went into details of the issue in the commit message here https://github.com/inventaire/inventaire/commit/4141906b7ea47fcbb6bf374104648706949b4db8 but here is a summary of what might be of interest for level-party:
An error in our code was making us build batch operations arrays with a big array mistakenly passed as an operation key. Somewhere between levelup
batchfunction and abstratct-leveldownbatchfunction, that array operation key was turned into a buffer, and the batch operations went on without throwing an error.Is this an expected behavior to be able to pass an array as a batch operation key? If yes:
_serializeKeyfrom a level-party db object, to make it reject an array passed as a key?Minimum code to reproduce it: