summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* OpenBSD: add support for CPU frequency (#2057)Giampaolo Rodola2022-01-161-3/+5
|
* add @u93 to list of sponsorsGiampaolo Rodola2022-01-071-2/+1
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* add @u93 to list of sponsorsGiampaolo Rodola2022-01-071-0/+2
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* move import on top of the fileGiampaolo Rodola2021-12-311-1/+1
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* pre-releaserelease-5.9.0Giampaolo Rodola2021-12-291-0/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* add sponsorhips / supporters @indeedeng and @PySimpleGUI; thanks a lot! ;)Giampaolo Rodola2021-12-281-0/+2
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* PSUTIL_DEBUG: print file + line number for C ext modules (#2005)Giampaolo Rodola2021-10-261-0/+24
|
* give CREDITS to @ilius for #1996 + update docGiampaolo Rodola2021-10-121-0/+1
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* expand Process.threads() doc (take inspiration from #1989)Giampaolo Rodola2021-10-041-3/+11
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Merge branch 'master' of github.com:giampaolo/psutilGiampaolo Rodola2021-10-031-1/+1
|\
| * Typo fixed (#1930)Daniel Asztalos2021-10-031-1/+1
| | | | | | Signed-off-by: asztalosdani <asztalosdani@gmail.com>
* | update doc re. to exception classesGiampaolo Rodola2021-10-031-10/+16
|/ | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Merge branch 'master' of github.com:giampaolo/psutilGiampaolo Rodola2021-09-261-2/+2
|\
| * Fix typos in documentation (#1970)Dmitry Gorbunov2021-07-241-2/+2
| |
* | give CREDITS to @scoutapm-sponsorships and Alexey Vazhnov for sponsorshipGiampaolo Rodola2021-09-261-0/+2
|/ | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* change tidelift logoGiampaolo Rodola2021-06-063-2/+35
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* add Chenyoo Hao to list of supportersGiampaolo Rodola2021-06-061-1/+3
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* give CREDITS to @sansecio for the new sponsorshipGiampaolo Rodola2021-05-141-1/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Re. #1210: add doc warning explaining that cpu_times() values can sometimes ↵Giampaolo Rodola2021-05-031-0/+6
| | | | | | go backwards Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* add @cybersecgeek to sponsorsGiampaolo Rodola2021-04-061-0/+1
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* update DEVNOTESGiampaolo Rodola2021-01-181-52/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Merge branch 'master' of github.com:giampaolo/psutilGiampaolo Rodola2020-12-291-1/+1
|\
| * Fix typo in index.rst (#1899)Andre F de Miranda2020-12-291-1/+1
| |
* | update docGiampaolo Rodola2020-12-291-12/+2
|/ | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* give CREDITS to @aristocratos for new sponsorship (thank you ;))Giampaolo Rodola2020-12-281-1/+2
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* update docGiampaolo Rodola2020-12-272-8/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Rename cpu_count_physical() to cpu_count_cores()Giampaolo Rodola2020-12-211-8/+8
| | | | | | | | | | This has always been cause of confusion, e.g. see: https://github.com/giampaolo/psutil/pull/1727#issuecomment-698934643 Removed the reference to "physical" from dostrings, functions and test. I still left it in the doc though, as it's more explanatory. Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* update docGiampaolo Rodola2020-12-191-1/+2
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* pre-releaseGiampaolo Rodola2020-12-191-0/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* add CONTRIBUTING.mdGiampaolo Rodola2020-12-132-33/+21
|
* Remove Travis and Cirrus, use GH also for FreeBSD (#1880)Giampaolo Rodola2020-11-151-14/+5
|
* remove misleading "in UTC" (#1882)zed2020-11-151-1/+1
| | | | | | | | | | | | | | | | | "seconds since the epoch" (value returned by `time.time()`) doesn't depend on the local time zone. It is the same time instance around the world. It is not in any particular time zone: ```python import datetime as DT import zoneinfo local_time = DT.datetime.fromtimestamp(seconds_since_epoch) # naive datetime object representing local time utc_time = DT.datetime.utcfromtimestamp(seconds_since_epoch) # naive datetime object representing utc time la_time = DT.datetime.fromtimestamp(seconds_since_epoch, zoneinfo.ZoneInfo("America/Los_Angeles")) # timezone aware dt ``` Here `local_time`, `utc_time`, `la_time` may correspond to different clock times but it is exactly the same time instance.
* Rewrite Linux prlimit() with ctypes (Linux wheels) (#1879)Giampaolo Rodola2020-11-152-92/+69
|
* Fix definition of RPM (#1870)Christopher Hewett2020-11-041-1/+1
| | | RPM is actually revolutions per minute, current docs say its rounds per minute
* disk_partitions() maxfile and maxpath (#1863)Giampaolo Rodola2020-10-241-11/+19
|
* pre releaseGiampaolo Rodola2020-10-231-1/+5
|
* [FreeBSD] process resource limits (#1859) (#809)Giampaolo Rodola2020-10-232-38/+49
|
* fix #1855 docGiampaolo Rodola2020-10-191-1/+4
|
* add sponsors in docGiampaolo Rodola2020-10-181-16/+45
|
* Update README (#1854)Giampaolo Rodola2020-10-182-0/+0
|
* Fix labeling in Process cpu_times() documentation (#1853)kellurs2020-10-151-1/+1
| | | Changed system_user to children_system to match the named tupple and expected behaviour. Change description to match.
* Update index.rst (#1835)Piotr Dworzynski2020-10-091-1/+1
| | | Fixed typo in documentation of user.name attribute.
* update doc for #1830 (net_if_stats() isup check if NIC is running)Giampaolo Rodola2020-09-211-1/+3
|
* give CREDITS for #1800 / @ArminGrunnerGiampaolo Rodola2020-08-131-2/+1
|
* pre-releaserelease-5.7.2Giampaolo Rodola2020-07-151-0/+1
|
* pre-releaseGiampaolo Rodola2020-07-151-0/+4
|
* pre-releaserelease-5.7.1Giampaolo Rodola2020-07-151-0/+4
|
* update personal site URLGiampaolo Rodola2020-06-161-3/+3
|
* update docGiampaolo Rodola2020-06-101-5/+6
|
* Memory leak test: take fluctuations into account (#1757)Giampaolo Rodola2020-05-131-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preamble ======= We have a [memory leak test suite](https://github.com/giampaolo/psutil/blob/e1ea2bccf8aea404dca0f79398f36f37217c45f6/psutil/tests/__init__.py#L897), which calls a function many times and fails if the process memory increased. We do this in order to detect missing `free()` or `Py_DECREF` calls in the C modules. When we do, then we have a memory leak. The problem ========== A problem we've been having for probably over 10 years, is the false positives. That's because the memory fluctuates. Sometimes it may increase (or even decrease!) due to how the OS handles memory, the Python's garbage collector, the fact that RSS is an approximation and who knows what else. So thus far we tried to compensate that by using the following logic: - warmup (call fun 10 times) - call the function many times (1000) - if memory increased before/after calling function 1000 times, then keep calling it for another 3 secs - if it still increased at all (> 0) then fail This logic didn't really solve the problem, as we still had occasional false positives, especially lately on FreeBSD. The solution ========= This PR changes the internal algorithm so that in case of failure (mem > 0 after calling fun() N times) we retry the test for up to 5 times, increasing N (repetitions) each time, so we consider it a failure only if the memory **keeps increasing** between runs. So for instance, here's a legitimate failure: ``` psutil.tests.test_memory_leaks.TestModuleFunctionsLeaks.test_disk_partitions ... Run #1: extra-mem=696.0K, per-call=3.5K, calls=200 Run #2: extra-mem=1.4M, per-call=3.5K, calls=400 Run #3: extra-mem=2.1M, per-call=3.5K, calls=600 Run #4: extra-mem=2.7M, per-call=3.5K, calls=800 Run #5: extra-mem=3.4M, per-call=3.5K, calls=1000 FAIL ``` If, on the other hand, the memory increased on one run (say 200 calls) but decreased on the next run (say 400 calls), then it clearly means it's a false positive, because memory consumption may be > 0 on second run, but if it's lower than the previous run with less repetitions, then it cannot possibly represent a leak (just a fluctuation): ``` psutil.tests.test_memory_leaks.TestModuleFunctionsLeaks.test_net_connections ... Run #1: extra-mem=568.0K, per-call=2.8K, calls=200 Run #2: extra-mem=24.0K, per-call=61.4B, calls=400 OK ``` Note about mallinfo() ================ Aka #1275. `mallinfo()` on Linux is supposed to provide memory metrics about how many bytes gets allocated on the heap by `malloc()`, so it's supposed to be way more precise than RSS and also [USS](http://grodola.blogspot.com/2016/02/psutil-4-real-process-memory-and-environ.html). In another branch were I exposed it, I verified that fluctuations still occur even when using `mallinfo()` though, despite less often. So that means even `mallinfo()` would not grant 100% stability.