Conversation
5bb1e8e to
9e5441d
Compare
9e5441d to
f876543
Compare
|
Thats awesome, thanks @cetra3, please help me to read the table correctly
it means 10MB accounted by the internal memory but the real usage was 20.7? |
|
Yes, that's right. The memory limit on the datafusion test is 10mb, but the measured heap is actually twice that amount. You would expect there is a bit of overhead in data structures etc.. but double the amount of memory is far too much I think |
true, in Comet we also were struggling with unexpected OOMs let me go through the approach |
|
|
||
| const MEMORY_LIMIT: usize = 10 * 1024 * 1024; // 10MB | ||
|
|
||
| #[tokio::test] |
There was a problem hiding this comment.
I am not sure whether these new IT tests are going to stay but if they do then maybe the dhat dev-dependency should be optional and loaded only when some new feature is enabled, e.g. memory-profiling, and all IT tests be gated behind this feature.
| ); | ||
|
|
||
| // Start profiling after table creation | ||
| let _profiler = dhat::Profiler::builder().testing().build(); |
There was a problem hiding this comment.
Here you start the profiling after the setup but in many of the other IT tests this is done before the setup
The limit is only for the FairSpillPool, not for the whole application. |
Which issue does this PR close?
Related to #20714 but doesn't actually fix any issues at the moment, merely highlights that memory accounting is currently inaccurate
Here's a table of measured heap profiles based upon these tests:
Rationale for this change
This adds some preliminary heap profile testing using
dhat-rsto record heap allocations and report on memory usage for a handful of canned queries. Each of them allow some head room as there can be some overhead (1.1x) in other parts of the process.While more test types can be added in the future, already most of these heap profile tests blow out memory usage.
For the failing tests, these are commented out with some information about why they might fail. Essentially we should raise PRs to fix memory accounting and then add the appropriate assertions.
What changes are included in this PR?
dhatas a dev dependencyAre these changes tested?
Yes, as they are only tests
Are there any user-facing changes?
None at this stage.