Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | refactor pywin/pypy depswheels3 | Giampaolo Rodola | 2020-05-23 | 2 | -3/+6 |
| | |||||
* | set timeout for wait() | Giampaolo Rodola | 2020-05-23 | 1 | -2/+2 |
| | |||||
* | refactor win tests | Giampaolo Rodola | 2020-05-23 | 1 | -15/+14 |
| | |||||
* | remove placeholders for open_files | Giampaolo Rodola | 2020-05-23 | 3 | -4/+0 |
| | |||||
* | fix import | Giampaolo Rodola | 2020-05-23 | 1 | -0/+1 |
| | |||||
* | fix race condition | Giampaolo Rodola | 2020-05-23 | 2 | -3/+8 |
| | |||||
* | skip unicode tests on pypy2 | Giampaolo Rodola | 2020-05-23 | 1 | -12/+12 |
| | |||||
* | revert previous commit | Giampaolo Rodola | 2020-05-23 | 1 | -2/+7 |
| | |||||
* | refactor isfile/path_strict funcs | Giampaolo Rodola | 2020-05-23 | 2 | -8/+3 |
| | |||||
* | fix other tests | Giampaolo Rodola | 2020-05-23 | 3 | -14/+12 |
| | |||||
* | take PYPY into account | Giampaolo Rodola | 2020-05-23 | 1 | -1/+2 |
| | |||||
* | skip tests | Giampaolo Rodola | 2020-05-23 | 1 | -0/+3 |
| | |||||
* | revert wmi refact | Giampaolo Rodola | 2020-05-23 | 1 | -25/+18 |
| | |||||
* | try to fix win err | Giampaolo Rodola | 2020-05-22 | 1 | -2/+0 |
| | |||||
* | skip wmi tests | Giampaolo Rodola | 2020-05-22 | 1 | -22/+27 |
| | |||||
* | disable windows specific tests on github | Giampaolo Rodola | 2020-05-22 | 2 | -5/+5 |
| | |||||
* | pypiwin32 -> pywin32 | Giampaolo Rodola | 2020-05-22 | 2 | -4/+2 |
| | |||||
* | increase sysmem tolerance | Giampaolo Rodola | 2020-05-22 | 1 | -1/+1 |
| | |||||
* | try to adjust test | Giampaolo Rodola | 2020-05-22 | 1 | -0/+2 |
| | |||||
* | fix exe | Giampaolo Rodola | 2020-05-22 | 2 | -4/+4 |
| | |||||
* | try to adjust test | Giampaolo Rodola | 2020-05-22 | 2 | -3/+3 |
| | |||||
* | Merge branch 'wheels3' of github.com:giampaolo/psutil into wheels3 | Giampaolo Rodola | 2020-05-22 | 0 | -0/+0 |
|\ | |||||
| * | temporarily disable open_files tests | Giampaolo Rodola | 2020-05-22 | 4 | -0/+5 |
| | | |||||
* | | try to fix win failure | Giampaolo Rodola | 2020-05-22 | 1 | -1/+1 |
| | | |||||
* | | undo last commit | Giampaolo Rodola | 2020-05-22 | 4 | -0/+5 |
|/ | |||||
* | try to adjust test | Giampaolo Rodola | 2020-05-19 | 1 | -1/+1 |
| | |||||
* | adjust deps | Giampaolo Rodola | 2020-05-19 | 3 | -10/+15 |
| | |||||
* | adjust flake8 | Giampaolo Rodola | 2020-05-19 | 2 | -6/+4 |
| | |||||
* | remove duplicate test | Giampaolo Rodola | 2020-05-19 | 5 | -69/+14 |
| | |||||
* | fix for floppy | Giampaolo Rodola | 2020-05-18 | 1 | -1/+2 |
| | |||||
* | refactor some tests | Giampaolo Rodola | 2020-05-18 | 3 | -38/+48 |
| | |||||
* | look for floppy | Giampaolo Rodola | 2020-05-18 | 1 | -0/+2 |
| | |||||
* | fix some tests | Giampaolo Rodola | 2020-05-18 | 4 | -14/+60 |
| | |||||
* | refactor FetchAll test | Giampaolo Rodola | 2020-05-18 | 1 | -8/+4 |
| | |||||
* | fix occasional false positives | Giampaolo Rodola | 2020-05-18 | 2 | -2/+4 |
| | |||||
* | enable github sponsors | Giampaolo Rodola | 2020-05-18 | 1 | -1/+1 |
| | |||||
* | Wheels2 (#1761) | Giampaolo Rodola | 2020-05-18 | 17 | -103/+314 |
| | |||||
* | Have GitHub build wheels on commit (#1758) | Grzegorz Bokota | 2020-05-16 | 5 | -6/+91 |
| | |||||
* | [Linux] Process.rlimit() does not handle LONG LONG properly (#1760) | Giampaolo Rodola | 2020-05-16 | 2 | -3/+2 |
| | |||||
* | add strncpy / PSUTIL_STRNCPY variant which adds null terminator (fix gcc-9 ↵ | Giampaolo Rodola | 2020-05-16 | 5 | -8/+13 |
| | | | | warning) | ||||
* | #1758: fix github failures | Giampaolo Rodola | 2020-05-15 | 6 | -21/+12 |
| | |||||
* | better #ifdef detection for prlimit() availbility | Giampaolo Rodola | 2020-05-15 | 2 | -26/+22 |
| | | | | | | | | | Rely on "__NR_prlimit64" availability and check GLIBC version only. Take kernel version out of the picture. This way it works on both CentOS 6 and 7. Also, have test_contracts.py tests assume prlimit() is always available, so that we will be notified (by failure). Ref: #1758 | ||||
* | shorter testfn | Giampaolo Rodola | 2020-05-15 | 1 | -3/+1 |
| | |||||
* | fix some tests | Giampaolo Rodola | 2020-05-15 | 3 | -7/+9 |
| | |||||
* | have leak test use 3M instead of 70M to avoid swapping out on CI | Giampaolo Rodola | 2020-05-13 | 1 | -1/+2 |
| | |||||
* | rename memleaks script | Giampaolo Rodola | 2020-05-13 | 7 | -6/+6 |
| | |||||
* | always execute python memleak tests on linux (just fewer times) | Giampaolo Rodola | 2020-05-13 | 2 | -55/+69 |
| | |||||
* | put fds test in mem leak class | Giampaolo Rodola | 2020-05-13 | 3 | -128/+70 |
| | |||||
* | remove dead code | Giampaolo Rodola | 2020-05-13 | 1 | -6/+0 |
| | |||||
* | Memory leak test: take fluctuations into account (#1757) | Giampaolo Rodola | 2020-05-13 | 10 | -206/+127 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. |