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

Resource exhaustion after refreshing floppy too many times #19

Closed
inexorabletash opened this issue Sep 10, 2017 · 4 comments
Closed

Resource exhaustion after refreshing floppy too many times #19

inexorabletash opened this issue Sep 10, 2017 · 4 comments

Comments

@inexorabletash
Copy link
Collaborator

@inexorabletash inexorabletash commented Sep 10, 2017

Eventually things go bad when Check Drives etc. is used too many times.

@inexorabletash

This comment has been minimized.

Copy link
Collaborator Author

@inexorabletash inexorabletash commented Dec 9, 2018

I believe the cause is that the file record memory (aux lc bank 2 at $Dxxx) gets fragmented. Each window needs a byte (count) plus 32 bytes per file.

@inexorabletash

This comment has been minimized.

Copy link
Collaborator Author

@inexorabletash inexorabletash commented Feb 28, 2019

Yep. So to fix, this would require defragmenting.

In open_directory the FileRecord instances are created. L485F and L485D track the lo (moves) and hi (fixed) ends of the $D000-$E000 buffer. Math is done to see if there's enough room for the entries. It's complicated. LE1F1 and/or LE202 is a table entry of some point (window to record list?) . Would need updating if compaction can be done.

inexorabletash added a commit that referenced this issue Jan 5, 2020
@inexorabletash

This comment has been minimized.

Copy link
Collaborator Author

@inexorabletash inexorabletash commented Jan 5, 2020

Good news and bad news!

Good news: There is compaction - see remove_window_filerecord_entries

Bad news: Space is only reclaimed for windows with owning icons (i.e. the vol/folder that opened it)

Good news: This gives us the following repro for a leak:

  1. Open window for volume (e.g. /HD)
  2. Open window for folder (e.g. /HD/A2.DESKTOP)
  3. Close the window for the volume
  4. Close the window for the folder

At this point:

  • filerecords_free_start does not drop down to $D000
  • window_icon_to_filerecord_list_count remains at 1

Repeating this 8 times would therefore exhaust the table, so no new windows can open without restarting. 💥

Bad news: Fixing this will require altering the table to use something other than the icon number, e.g. it could use the window number.

@inexorabletash

This comment has been minimized.

Copy link
Collaborator Author

@inexorabletash inexorabletash commented Jan 5, 2020

For reference: cached_window_id is updated by the time open_directory is called, but active_window_id is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.