From dd66144a3b1da4256e03e82f874e476a5c4e1d66 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Sat, 10 Jul 2021 22:27:25 -0700 Subject: [PATCH] :zap: memory usage info --- docs/building.md | 3 +-- main.cpp | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/building.md b/docs/building.md index af4be12..c8bc699 100644 --- a/docs/building.md +++ b/docs/building.md @@ -5,8 +5,7 @@ as CCash is very lightweight it can run on practically any device but here are some tips: * single core machines should toggle `MULTI_THREADED` to `false` * if your server is sufficiently active as so that each save freqeuncy saving is highly likely then `CONSERVATIVE_DISK_SAVE` should be toggled to `false` -* `MAX_LOG_SIZE` should be adjusted as it takes up the most memory usage/storage at about 173 bytes in memory and (size) in disk space per log. Setting to 0 will not even compile logs -* with no users memory usage is 8.792517 Mb +* `MAX_LOG_SIZE` should be adjusted as it takes up the most memory usage/storage of the ledger's features at ~202 bytes in memory and (size) in disk at default settings. Setting to 0 will not even compile logs ## Drogon Depedencies diff --git a/main.cpp b/main.cpp index 1bd3116..84bed6e 100644 --- a/main.cpp +++ b/main.cpp @@ -58,8 +58,9 @@ int main(int argc, char **argv) //Loading users from users.json bank.Load(); + size_t num_of_logs = bank.NumOfLogs(); std::cout << "\n\nLoaded " << bank.NumOfUsers() << " Users" - << "\nLoaded " << bank.NumOfLogs() << " Logs" + << "\nLoaded " << num_of_logs << " Logs : " << (float)(num_of_logs * (90 + 80 + (max_name_size * 2))) / 1048576 << "Mb" //90:string representation(heap), sizeof(Transaction), max_name_size*2:filled to&from(heap) << "\nLoaded " << bank.SumBal() << " CSH" << std::endl; //flushing before EventLoop