Deleting the whole AtomSpace takes too long
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenCog |
Won't Fix
|
High
|
Unassigned |
Bug Description
[bug copied from Petaverse's bugzilla]
Deleting the AtomSpace object of an EmbodimentCogServer (specifically, an OPC) in its destructor takes too long.
The bigger the AtomSpace is, the longer it takes to be deleted (it seems a polynomial rate). So, this gets more critical after some time (several minutes) OPC is running. As an example, an AtomSpace that generates a dump file (using SavingLoading) of 5M bytes takes 25 seconds to be deleted. This may cause an error when someone unload a pet in a Virtual World and tries to reload it just after that (since the old OPC process will be stuck on AtomSpace deletion and will prevent a new OPC process to be started).
For now, since the AtomSpace is not released until cogserver process exits, it's not necessary to delete it. In fact, Cogserver just creates an instance of AtomSpace in its constructor but does not delete it in its destructor (probably because of this issue).
So, for now, AtomSpace deletion is disabled in OPC's destructor as well. This makes memory leaks to be detected by memory check tools (like valgrind). For this reason, there is special handling for this case in OPC's destructor using the CHECK_OPC_
description: | updated |
Changed in opencog: | |
importance: | Undecided → Medium |
Changed in opencog: | |
importance: | Medium → High |
status: | New → Confirmed |
summary: |
- Deleting an AtomSpace object takes too long + Deleting the whole AtomSpace takes too long |
Changed in opencog: | |
status: | Confirmed → Won't Fix |
Please retest, this may be fixed already.
Approx half-a-year ago, I had made large changes to how AtomSpace stores indexes, in order to improve the deletion times of single atoms -- the deletion of just one atom was taking a very long time, (minutes!) when the atomspace got large.
I believe that these changes should dramatically improve atomspace deletion time, but have not tested.