Commit Graph

3 Commits

Author SHA1 Message Date
Nicholas Dudfield
529d77d4b7 test: parameterize RelationalDatabase_test for multiple backends
- Add backend parameter to all test methods
- Parse backends from --unittest-arg (CSV format: sqlite,rwdb)
- Skip dbHasSpace checks for SQLite (uses in-memory databases in standalone mode)
- Remove unnecessary database path setup/cleanup
- Rename getDB() to getInterface()
2025-08-20 13:24:35 +07:00
Nicholas Dudfield
1703574d50 fix: add actual transaction data to RWDB memory usage calculations
The existing memory usage functions only counted structural overhead
(sizeof of containers and pointers) but missed the actual transaction
and metadata blob sizes. This caused severe underreporting - showing
KBs when actually using MBs or GBs.

Changes:
- Keep existing structural overhead calculations
- Add actual transaction/metadata serialized data sizes
- Use transactionMap_ as single source to avoid double-counting
- Add MAP_NODE_OVERHEAD constant for red-black tree nodes (~40 bytes each)
- Use vector::capacity() instead of size() for actual allocated memory
- Include ledger's transaction map node overhead in ledger calculations
- Change internal calculation to uint64_t to prevent overflow
- Add clear comments explaining what each section measures

These improvements provide much more accurate memory reporting for
monitoring and diagnostic purposes.
2025-08-20 09:51:48 +07:00
Denis Angell
1245611226 add test file 2025-08-18 19:37:35 +02:00