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

Fix memory calculation #40

Merged
merged 3 commits into from
Jan 12, 2025
Merged

Conversation

Danstiv
Copy link
Contributor

@Danstiv Danstiv commented Sep 9, 2024

Hello!

Currently virtual memory is not displayed correctly.

You can verify this by comparing the resourceMonitor readings with the readings in Task Manager > Performance > Memory.

This problem is solved in this pr.

The main idea is that we don't need swap file information at all, which means there is now no delay when first getting memory information.

You can read more here.

@Danstiv
Copy link
Contributor Author

Danstiv commented Sep 10, 2024

@josephsl

@Danstiv
Copy link
Contributor Author

Danstiv commented Jan 12, 2025

Hello @josephsl!
Could you review please?

@josephsl
Copy link
Collaborator

Hi,

I see. This does help with resolving freezes when memory info is retrieved the first time. However, I have some concerns with this PR:

  1. Is there reason for separating memory calculation into its own module? I think the contents of the memory module can be part of the main global plugin module or the function bodies be part of memory info script (I'm testing this approach at the moment).
  2. If memory module is needed, I advise changing the indentation type from four spaces to tabs.
  3. I assume the PR works with NVDA 2024.2. If not, please test that configuration as 2024.2 is the minimum NVDA version declared in the add-on manifest (this is because the proposed swap memory calculation involves using Widows internal modules inside psutil).

Thanks.

@Danstiv
Copy link
Contributor Author

Danstiv commented Jan 12, 2025

Is there reason for separating memory calculation into its own module? I think the contents of the memory module can be part of the main global plugin module or the function bodies be part of memory info script (I'm testing this approach at the moment).

I don’t see a big difference in where exactly the code is located; I believe that, if possible, the components should be separated into different modules.

If memory module is needed, I advise changing the indentation type from four spaces to tabs.

No problem, I'll commit it within an hour.

please test that configuration as 2024.2 is the minimum NVDA version declared in the add-on manifest

Tested it. Works correctly in 2024.2.

@josephsl
Copy link
Collaborator

Hi,

Approved with follow-up change: memory functions are not separated into the memory module to align with other scripts. We can revisit this follow-up change if a PR to separate psutil calls into a separate module is warranted.

Thanks.

@josephsl josephsl merged commit df0eb0b into kefaslungu:main Jan 12, 2025
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

Successfully merging this pull request may close these issues.

2 participants