https://github.com/zombocom/get_process_mem
Get memory usage of a process in Ruby
https://github.com/zombocom/get_process_mem
Keywords from Contributors
rubygems mvc activerecord activejob rack multithreading devise rack-middleware crash-reporting sinatra
Last synced: about 22 hours ago
JSON representation
Repository metadata
Get memory usage of a process in Ruby
- Host: GitHub
- URL: https://github.com/zombocom/get_process_mem
- Owner: zombocom
- Created: 2014-02-09T01:59:51.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T20:43:41.000Z (over 1 year ago)
- Last Synced: 2025-12-10T23:57:42.091Z (30 days ago)
- Language: Ruby
- Size: 69.3 KB
- Stars: 483
- Watchers: 9
- Forks: 34
- Open Issues: 4
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
README.md
Get Process Memory
Do you need to get the memory usage of a process? Great because this library does that.
Install
In your Gemfile add
gem 'get_process_mem'
then run $ bundle install.
If you're using Windows you'll also need to have the sys-proctable gem.
Use It
Get the current process memory usage:
mem = GetProcessMem.new
puts mem.inspect
#<GetProcessMem @mb=24.28125 @gb=0.023712158203125 @kb=24864.0 @bytes=25460736 >
mem.bytes # => 25460736
mem.kb # => 24864.0
mem.mb # => 24.28125
mem.gb # => 0.023712158203125
Note: All numeric values returned as a float except bytes which is an integer.
Get memory usage of another process:
`echo 'nothing to see here' > tmplogf`
pid = Process.spawn('tail -f tmplog')
mem = GetProcessMem.new(pid)
puts mem.inspect
# => #<GetProcessMem @mb=0.48828125 @gb=0.000476837158203125 @kb=500.0 @bytes=512000 >
Process.kill('TERM', pid)
Process.wait(pid)
mem.inspect
# => "#<GetProcessMem @mb=0.0 @gb=0.0 @kb=0.0 @bytes=0>"
`rm tmplog`
On Linux, for memory size we return the RSS or the Resident Set Size, basically how much memory the program takes up in RAM at the time, including all the shared memory.
License
MIT
Owner metadata
- Name: ZomboCom
- Login: zombocom
- Email:
- Kind: organization
- Description: Welcome ... to ZomboCom. This ... is ... ZomboCom. Welcome. This is ZomboCom; welcome ... to ZomboCom. You can do anything at ZomboCom. Anything at all
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/12397488?v=4
- Repositories: 17
- Last ynced at: 2024-03-25T20:34:25.400Z
- Profile URL: https://github.com/zombocom
GitHub Events
Total
- Issues event: 1
- Watch event: 21
- Issue comment event: 1
- Fork event: 4
Last Year
- Issues event: 1
- Watch event: 13
- Issue comment event: 1
- Fork event: 4
Committers metadata
Last synced: 1 day ago
Total Commits: 66
Total Committers: 14
Avg Commits per committer: 4.714
Development Distribution Score (DDS): 0.364
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| schneems | r****n@g****m | 42 |
| Karl Söderström | k****m@g****m | 6 |
| Frederick Cheung | f****g@g****m | 4 |
| pavel | p****y@e****z | 3 |
| wonda-tea-coffee | r****a@c****p | 2 |
| technogeeky | t****b@g****m | 1 |
| Stan Hu | s****u@g****m | 1 |
| Olle Jonsson | o****n@g****m | 1 |
| Juanito Fatas | k****0@g****m | 1 |
| Elia Schito | e****a@s****e | 1 |
| Dave Gynn | d****n@g****m | 1 |
| Ankit gupta | a****8@g****m | 1 |
| Andrew Selder | a****r@m****m | 1 |
| Andrew Selder | a****r@u****m | 1 |
Committer domains:
- usertesting.com: 1
- mac.com: 1
- schito.me: 1
- crowdworks.co.jp: 1
- easy.cz: 1
Issue and Pull Request metadata
Last synced: 25 days ago
Total issues: 20
Total pull requests: 33
Average time to close issues: 11 months
Average time to close pull requests: 5 months
Total issue authors: 15
Total pull request authors: 16
Average comments per issue: 5.3
Average comments per pull request: 1.67
Merged pull request: 29
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 1.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- schneems (4)
- aselder (2)
- jjb (2)
- yovasx2 (1)
- erwanlr (1)
- LucasCioffi (1)
- edariedl (1)
- vusaalab (1)
- wonda-tea-coffee (1)
- nsallis (1)
- andrewngo (1)
- nathany (1)
- dgynn (1)
- bdmac (1)
- wjordan (1)
Top Pull Request Authors
- schneems (11)
- ksoderstrom (3)
- ahorek (3)
- wonda-tea-coffee (2)
- aselder (2)
- fcheung (2)
- stanhu (1)
- Filirom1 (1)
- technogeeky (1)
- olleolleolle (1)
- MSP-Greg (1)
- elia (1)
- dgynn (1)
- JuanitoFatas (1)
- bdmac (1)
Top Issue Labels
Top Pull Request Labels
Dependencies
- sys-proctable >= 0
- rake ~> 12 development
- sys-proctable ~> 1.2 development
- test-unit ~> 3 development
- ffi ~> 1.0
- actions/checkout v1 composite
- actions/checkout v4 composite
- ruby/setup-ruby v1 composite
Score: 8.827321452697849