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

Add getAvailablePhysicalMemory() (Memory that is available for use) #11

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

dev-kasibhatla
Copy link

Addresses #4, #8
This is only for Android and Linux. On other platforms, getFreePhysicalMemory() is returned

Details

  • This method returns the amount of usable physical memory (RAM) in bytes, which can be reclaimed for use by the system.
  • This change addresses a semantic issue with the existing getFreePhysicalMemory() method, which reports unused memory - memory that isn't occupied but might not be available for allocation.
  • On Android and Linux, getAvailablePhysicalMemory() now accurately reflects the "available memory" typically shown in device settings and diagnostic apps, aligning with how most tools report memory that can be utilized.

Additional changes:
I have also added a standard .gitignore

Notes for maintainer

  • With the new additions in .gitignore, pub.dev will ask warn you about .vscode/ and version/ directories being checked into git. There's 3 solutions
    1. Remove those from git (ideal)
    2. Add entries to .pubignore
    3. Remove entries from .gitignore
  • On my fork, I have also written a more comprehensive readme, updated examples, compatibility info. I did not include it because it's not relevant to this issue

On Linux and Android platforms, this will correctly return the expected of value of RAM that can be used (rather than RAM that is unused)

`getFreePhysicalMemory` is kept unchages for those using it for its correct semantic reasons
@bsutton bsutton merged commit 5dea86b into onepub-dev:master Nov 15, 2024
@bsutton
Copy link
Collaborator

bsutton commented Nov 15, 2024

If you want to merged the additional files so we go back to one package.
Happy to add you to a contributor to this repo.

I'm keen to limit the proliferation of essentially identical packages on pub.dev.

@corepuncher
Copy link

If you want to merged the additional files so we go back to one package. Happy to add you to a contributor to this repo.

I'm keen to limit the proliferation of essentially identical packages on pub.dev.

If you are going to update to pub dev soon, I will hold off on updating from the other location, just so I don't get my wires crossed later on. Great addition, thanks both of you!

@bsutton
Copy link
Collaborator

bsutton commented Nov 19, 2024 via email

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.

3 participants