Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | disable flaky test + small Makefile refact | Giampaolo Rodola | 2023-01-24 | 1 | -1/+1 |
| | |||||
* | feature: use ABI3 for cp36+ (#2102) | Matthieu Darbois | 2022-10-21 | 1 | -45/+0 |
| | |||||
* | resolve conflicts | Giampaolo Rodola | 2022-09-19 | 1 | -1/+1 |
|\ | | | | | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com> | ||||
| * | Fix typos | Kian-Meng Ang | 2022-01-27 | 1 | -1/+1 |
| | | |||||
* | | Fix AppVeyor CI (#2111) | Matthieu Darbois | 2022-06-05 | 1 | -0/+1 |
|/ | |||||
* | 3.6 wheels5.9.0-py3.6-wheels | Giampaolo Rodola | 2022-01-07 | 1 | -0/+8 |
| | | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com> | ||||
* | Fix CI tests / wheels / workflow (#2024) | Giampaolo Rodola | 2021-11-29 | 1 | -8/+0 |
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com> | ||||
* | appveyor: add support for Python 3.10 (#2012) (#2015) | Shannon Pamperl | 2021-11-14 | 1 | -0/+10 |
| | |||||
* | PSUTIL_DEBUG: print file + line number for C ext modules (#2005) | Giampaolo Rodola | 2021-10-26 | 1 | -1/+0 |
| | |||||
* | CI: run linters | Giampaolo Rodola | 2020-12-17 | 1 | -1/+1 |
| | | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com> | ||||
* | Remove Travis and Cirrus, use GH also for FreeBSD (#1880) | Giampaolo Rodola | 2020-11-15 | 1 | -2/+12 |
| | |||||
* | Fix py 3.9 [WinError 998] Invalid access to memory location (#1866) | Giampaolo Rodola | 2020-10-31 | 1 | -8/+11 |
| | |||||
* | Memory leak test: take fluctuations into account (#1757) | Giampaolo Rodola | 2020-05-13 | 1 | -0/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | Add C linter script (#1698) | Giampaolo Rodola | 2020-02-18 | 1 | -1/+1 |
| | |||||
* | Properly handle PID type in C (#1672) | Giampaolo Rodola | 2020-01-29 | 1 | -7/+1 |
| | |||||
* | travis/appveyor: add support for Python 3.8 (#1625) | Hugo van Kemenade | 2019-11-20 | 1 | -0/+8 |
| | |||||
* | revert last appveyor change for 3.8 | Giampaolo Rodola | 2019-10-24 | 1 | -8/+8 |
| | |||||
* | appveyor: add python 3.8; drop 3.5 | Giampaolo Rodola | 2019-10-21 | 1 | -8/+8 |
| | |||||
* | appveyor: run print scripts after tests | Giampaolo Rodola | 2019-02-27 | 1 | -0/+2 |
| | |||||
* | force appveyor runrelease-5.5.1 | Giampaolo Rodola | 2019-02-15 | 1 | -1/+1 |
| | |||||
* | appveyor: retire 3.5, add 3.7 | Giampaolo Rodola | 2018-07-15 | 1 | -18/+7 |
| | |||||
* | apveyor: reset py 3.4 and remove 3.7 (not available yet) | Giampaolo Rodola | 2018-06-27 | 1 | -8/+8 |
| | |||||
* | appveyor: remove py 3.4 and add 3.7 | Giampaolo Rodola | 2018-06-26 | 1 | -8/+8 |
| | |||||
* | 771 Windows CPU count (#1257) | Giampaolo Rodola | 2018-04-13 | 1 | -14/+4 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * use GetLogicalProcessorInformation() to get logical cpu_count() * return None if cpu_count() is undetermined + add mock test * style * factor out logical CPU num fun * remove unused code * psutil_get_num_cpus(): provide an option to fail on err * add comments * reuse get_num_cpus() function * error out if get_num_cpus() fail * use GetLogicalProcessorInformationEx to get phys CPU num * on win vista/xp just return None for phys CPU count * rename vars * fix C compiler warnings + remove mingw workarounds * return None if phys cpu count cant' be determined; update HISTORY * update HISTORY * update doc * add WMI tests * refactor tests * print debug msg for cpu phys returning None on win < 7 * try to fix win test * appveyor debug * fix typo * adjust appveyor 64 bit versions * debug msg * fix for loop * re-enable python versions * (maybe) finally fix GetLogicalProcessorInformationEx return len | ||||
* | and another one | Giampaolo Rodola | 2018-04-12 | 1 | -1/+1 |
| | |||||
* | another appveyor adjustment | Giampaolo Rodola | 2018-04-12 | 1 | -1/+1 |
| | |||||
* | adjust win deps | Giampaolo Rodola | 2018-04-12 | 1 | -4/+1 |
| | |||||
* | appveyor: use a pywin32 version which works with python 3.4 | Giampaolo Rodola | 2018-03-29 | 1 | -1/+1 |
| | |||||
* | try to fix appveyor failure | Giampaolo Rodola | 2018-03-29 | 1 | -1/+1 |
| | |||||
* | try to fix appveyor / setuptools | Giampaolo Rodola | 2018-03-29 | 1 | -0/+1 |
| | |||||
* | fix appveyor.yml syntax | Giampaolo Rodola | 2018-03-29 | 1 | -18/+18 |
| | |||||
* | try to fix appveyor | Giampaolo Rodola | 2018-03-28 | 1 | -2/+0 |
| | |||||
* | try to fix appveyor | Giampaolo Rodola | 2018-03-28 | 1 | -24/+24 |
| | |||||
* | fix appveyor failure, see ↵ | Giampaolo Rodola | 2018-03-28 | 1 | -1/+1 |
| | | | | https://ci.appveyor.com/project/giampaolo/psutil/build/job/6in5bk62ekiploys | ||||
* | appveyor: do not use only_commit files directive as it no longer works | Giampaolo Rodola | 2018-03-28 | 1 | -21/+23 |
| | |||||
* | Revert "Move tests out of package to top level directory (#1232)" (#1242) | Giampaolo Rodola | 2018-03-11 | 1 | -8/+8 |
| | | | This reverts commit b578d2febfd35f80fcfa1ce1bdf18d44d21b1581. | ||||
* | Move tests out of package to top level directory (#1232) | Jon Dufresne | 2018-03-09 | 1 | -8/+8 |
| | | | | | | | | Cleanly separates tests from the package itself. Prevents the tests being installed to site-packages. Tests are still distributed with the source distribution by MANIFEST.in. Avoids installing tests in production environments, leading to less total code in the environment. | ||||
* | enable pip cache in appveyor build (#1221) | Thijs Triemstra | 2018-02-20 | 1 | -0/+3 |
| | |||||
* | 1173 debug mode (#1176) | Giampaolo Rodola | 2017-11-14 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | * implement PSUTIL_DEBUG from C module * update doc * add psutil_debug() utility function * update doc * enable PSUTIL_DEBUG for tests * update appveyor.yml * change psutil_debug() signature so that it can accept variable num of args * provide DEBUG info in psutil_raise_for_pid() * properly print debug message * do not print too much | ||||
* | appveyor: enable python warnings when running tests | Giampaolo Rodola | 2017-11-12 | 1 | -1/+1 |
| | |||||
* | #1053: drop python 3.3 support | Giampaolo Rodola | 2017-11-08 | 1 | -8/+0 |
| | |||||
* | try to fix appveyor | Giampaolo Rodola | 2017-10-20 | 1 | -1/+1 |
| | |||||
* | automatically set PSUTIL_TEST env var during tests | Giampaolo Rodola | 2017-10-20 | 1 | -1/+1 |
| | |||||
* | re: #1120 / PEP527: no longer provide .exe files for Windows | Giampaolo Rodola | 2017-09-08 | 1 | -1/+0 |
| | |||||
* | set PSUTIL_TESTING env var for CI services | Giampaolo Rodola | 2017-05-18 | 1 | -1/+1 |
| | |||||
* | Try to fix arcan appveyor err: | Giampaolo Rodola | 2017-05-17 | 1 | -1/+1 |
| | | | | - https://ci.appveyor.com/project/giampaolo/psutil/build/1240/job/91n29tt3es7os2ut | ||||
* | fix appveyor build | Giampaolo Rodola | 2017-05-13 | 1 | -1/+1 |
| | |||||
* | fix appveyor build | Giampaolo Rodola | 2017-05-13 | 1 | -1/+1 |
| | |||||
* | fix windows test; also do make clean on CI services in order to show python ↵ | Giampaolo Rodola | 2017-05-13 | 1 | -0/+1 |
| | | | | warnings | ||||
* | #1058: enable warnings on make.bat, appveyor and travis | Giampaolo Rodola | 2017-05-12 | 1 | -1/+1 |
| |