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

[#125] Ensuring objects are deleted properly #300

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

angeloprobst
Copy link
Collaborator

test.metta.gz

Steps to run:

  1. Start Redis (port 29000) and Mongo (port 28000) and load them with the attached test.metta.gz file (use das-cli for that).
  2. Ensure the following vars are set on your local env:
DAS_MONGODB_HOSTNAME=localhost
DAS_MONGODB_PASSWORD=dassecret
DAS_MONGODB_PORT=28000
DAS_MONGODB_USERNAME=dbadmin
DAS_REDIS_HOSTNAME=localhost
DAS_REDIS_PORT=29000
  1. From the repo root, build all: make build-all
  2. From the repo root, run AB: make run-attention-broker
  3. In a separate terminal, from the repo root, run Query Agent: make run-query-agent
  4. In a separate terminal, from the repo root, run the following query:
bash -x src/scripts/run.sh query \
  "localhost:31701" \
  "localhost:31700" \
  AND 2 \
    LINK_TEMPLATE Expression 3 \
      NODE Symbol Contains \
      VARIABLE sentence1 \
      LINK Expression 2 \
        NODE Symbol Word \
        NODE Symbol '"bbb"' \
    LINK_TEMPLATE Expression 3 \
      NODE Symbol Contains \
      VARIABLE sentence2 \
      LINK Expression 2 \
        NODE Symbol Word \
        NODE Symbol '"aaa"'
  1. Check the amount of memory allocated by the Query Agent:
ps faux | grep 'query_broker 31700' | grep -Ev '(docker|grep|bash)'

Expected output (in this example, QA allocated ~311MB):
image

  1. Execute the steps 6 and 7 multiple times to check if the memory grows continuously.

Comment on lines -119 to -127
template <class AnswerType>
QueryNodeServer<AnswerType>::~QueryNodeServer() {
this->graceful_shutdown();
if (this->query_answer_processor != NULL) {
this->query_answer_processor->join();
delete this->query_answer_processor;
this->query_answer_processor = NULL;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be removed because the base class destructor is already doing the same.

Comment on lines -191 to -199
template <class AnswerType>
QueryNodeClient<AnswerType>::~QueryNodeClient() {
this->graceful_shutdown();
if (this->query_answer_processor != NULL) {
this->query_answer_processor->join();
delete this->query_answer_processor;
this->query_answer_processor = NULL;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be removed because the base class destructor is already doing the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant