Comments (2)
Hi,
Short answer: it's possible, but expensive to calculate.
You can think of whitedb memory allocation as working on two levels. There are bigger chunks that hold one type of objects, such as integers and strings. When one chunk gets filled, another of the same type is allocated. This "chunk level" memory is cheap to keep track of and this is what the wg_database_freesize()
reports. However, it is not necessary to free those chunks and the side effect is that the size reported by that function never decreases.
The objects inside the chunks are freed and the memory does get reused. But the information about the free objects is stored in a way that makes it expensive to add up all the available space.
If you're curious then you can look at the function wg_show_db_area_header()
and the functions that it calls in Test/dbtest.c
For practical purposes the best way would be to implement bookkeeping inside the whitedb library. There are a limited number of functions that create and free objects in Db/dballoc.c
.
from whitedb.
ok, thanks
from whitedb.
Related Issues (20)
- wgdb ls or is there a way to list all databases in memory? HOT 1
- Support for extending database size? HOT 4
- dump files not working after reboot HOT 1
- Ordering of result of wg_find_record_int function HOT 1
- Compilation Warnings on Windows (x64) HOT 1
- Question: find first missing entry HOT 2
- Image processing HOT 1
- Incorrect consistency check
- wg memory error: cannot attach to shared memory (No permission). with gtest HOT 2
- http://whitedb.org/ is down HOT 1
- commercial licence HOT 1
- Using whitedb between (docker) containers HOT 2
- Clarification HOT 1
- DB names HOT 2
- indexapi.h missing C extern for C++ HOT 1
- Issue deleting a record who has the same value in a Template Index Column as another record HOT 5
- Error when restoring the database (with indexing) from the log file.
- License Question HOT 2
- BUILD FAIL: configure cannot guess build type HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whitedb.