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

Missing Dereference in C++ Interface #15

Closed
SSoelvsten opened this issue Aug 17, 2023 · 1 comment · Fixed by #16
Closed

Missing Dereference in C++ Interface #15

SSoelvsten opened this issue Aug 17, 2023 · 1 comment · Fixed by #16
Assignees
Labels
bug Something isn't working ___.cpp C++ wrapper

Comments

@SSoelvsten
Copy link
Owner

CAL seems to use much more memory than would be expected. For the 14-Queens problem, where the largest BDD only is 4 GiB in size, CAL runs out of memory on my machine after having filled 16 GiB of RAM and 8 GiB of swap.

When running the Tic-Tac-Toe 22 benchmark, we get the following output. Please note the number of nodes that were garbage collected - specifically notice nothing has been garbage collected.

Tic-Tac-Toe with 22 crosses (CAL [BDD] 8096 MiB):

   CAL [BDD] initialisation:
   | time (ms):              1

   Initial decision diagram:
   | size (nodes):           990
   | time (ms):              0

   Applying constraints:
   | final size (nodes):     6560564
   | time (ms):              336215

   counting solutions:
   | number of solutions:    9734400
   | time (ms):              3444

   total time (ms):          339659

**** CAL modifiable parameters ****
Node limit: 0
Garbage collection enabled: yes
...
Repacking after GC Threshold: 0.750000
**** CAL statistics ****
Total BDD Node Usage : 256739576 nodes, 8215666432 Bytes
Peak BDD Node Usage : 202440128 nodes, 6478084096 Bytes
Number of nodes locked: 42457
...
Number of nodes garbage collected: 0
number of garbage collections: 13
...
garbage collection limit: 404880256
@SSoelvsten SSoelvsten added bug Something isn't working ___.cpp C++ wrapper labels Aug 17, 2023
@SSoelvsten SSoelvsten self-assigned this Aug 17, 2023
@SSoelvsten
Copy link
Owner Author

Just to confirm, here are some statistics on Tic-Tac-Toe 22 with CAL after the rebase merge.

Number of nodes garbage collected: 190829368
number of garbage collections: 20

This is roughly equivalent to 190829368 * 3 * 8 bytes, i.e. 4.8 GiB garbage collected. Specifically, if we look at its own reported unique node table size we see it has used about 4 GiB a tmost

Total BDD Node Usage : 66592604 nodes, 2130963328 Bytes
Peak BDD Node Usage : 125127046 nodes, 4004065472 Bytes

This seems quite reasonable. Looking at the System Monitor The peak memory was about 8 GiB. The remaining 3 GiB must be the OS, computation cache and the unreduced nodes. That seems realistic.

This is much less than the 14 GiB total usage (counting duplicates).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ___.cpp C++ wrapper
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant