opennars / OpenNARS-for-Applications

General reasoning component for applications based on NARS theory.
https://cis.temple.edu/~pwang/NARS-Intro.html
MIT License
89 stars 39 forks source link

Design: Precondition table needs too much memory with "too many ops" #241

Open PtrMan opened 1 year ago

PtrMan commented 1 year ago

How to reproduce? Set OPERATIONS_MAX to something like 15 or 32.

In Concept.h we have

 Table precondition_beliefs[OPERATIONS_MAX+1];

this causes OOM for machines with <1GB and default config for number of concepts.

PtrMan commented 1 year ago

One way which is compatible with the preallocation philosophy of memory managment is to add a custom memory allocator + manager under AIKR for entry's which are utilized.

automenta commented 1 year ago

This application ought to apply AIKR principles https://cis.temple.edu/~pwang/Publication/AIKR.pdf

patham9 commented 1 year ago

"One way which is compatible with the preallocation philosophy of memory managment is to add a custom memory allocator + manager under AIKR for entry's which are utilized."

I agree it's quite space-wasting. Let's see how the stats look like, if the concepts have their implication tables full for most long-term runs it won't help much. While if most of them are quite empty, there will be great benefit of such an allocator. Let's see.