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

HeadlessChildModel instances not being disposed of and headless model viewer displaying wrong child model #146

Open
qiemem opened this issue Feb 3, 2023 · 0 comments

Comments

@qiemem
Copy link
Member

qiemem commented Feb 3, 2023

Mostly opening this to document a weird state I've arrived in. I don't have repro steps, but will update if I can figure them out. If I had to guess at repro steps, it would be something like:

  1. Run a model with a headless child model.
  2. ls:show 0 to view the world state.
  3. With that open, edit the code of the child model (opened with the LevelSpace menu)
  4. Maybe something like do ls:reset and rerun model with the viewer still open? Basically, having a bunch of ways of having the child model be referenced and then doing things that might change one reference but not the others.

I arrived at a state where an instance of a headless child model being used by the model and the one displayed with ls:show are different. The child model's command center seemed to talk to the same instance that the model used, as can be seen here:

image

Note that the world size seen in the view is the world size the child model has on initial load, but then it changes when run.

Looking at a heap dump, we see that there are, in fact, 6 instance of HeadlessChildModel:

image

HeadlessChildModel#5 appears to be the one used by the model and the command center, as indicated by the number of turtles in its world (the command center indicated 11 turtles, as did running [ count turtles ] ls:of 0 in the parent model):

image

HeadlessChildModel#6 appears to be used by the backing model manager:

image

but also seems to have agents in it:

image

I haven't been able to figure out which headless model is the one actually being displayed by the model viewer, but the heapdump is attached.

heapdump-1675355329037.zip

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

No branches or pull requests

1 participant