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
Labels
bug DeskTop DeskTop bugs or feature requests root-cause-identified
Milestone

Comments

@inexorabletash
Copy link
Collaborator

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

@inexorabletash inexorabletash added bug-in-original DeskTop DeskTop bugs or feature requests labels Sep 10, 2017
@inexorabletash
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@inexorabletash inexorabletash added this to the 1.2 milestone Feb 6, 2021
inexorabletash added a commit that referenced this issue Jul 17, 2023
INTBASIC.SYSTEM:
* d8f6a4b Run HELLO automatically if present

CLOCK.SYSTEM:
* b182a53 The Cricket!: fix hang on Total Replay (#19)
* 9401723 The Cricket!: further refinements to 'SSC init' (#18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug DeskTop DeskTop bugs or feature requests root-cause-identified
Projects
None yet
Development

No branches or pull requests

1 participant