Skip to content

Conversation

@kletkavrubashku
Copy link
Contributor

@kletkavrubashku kletkavrubashku commented Aug 12, 2025

Summary:

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Differential Revision: D79902261

Test plan:

SET session native_debug_memory_pool_name_regex="^op\.11\.\d+\.\d+\.TableScan$"
SET session native_debug_memory_pool_warn_threshold_bytes="1MB"

Example logs:

​W0810 21:42:07.801401  1256 [Driver165] MemoryPool.cpp:1230] [MEM] [MemoryPool] Memory pool 'op.11.0.13.TableScan' exceeded warning threshold of 1048576 bytes with allocation of 16384 bytes, resulting in total size of 1054966 bytes.
--
​======== Allocation Stack ========
​# 0  facebook::velox::memory::MemoryPoolImpl::recordAllocDbg(void const*, unsigned long)
​# 1  facebook::velox::memory::MemoryPoolImpl::allocate(long, std::optional<unsigned int>)
​# 2  boost::intrusive_ptr<facebook::velox::Buffer> facebook::velox::AlignedBuffer::allocate<int>(unsigned long, facebook::velox::memory::MemoryPool*, std::optional<int> const&, bool)
​# 3  void facebook::velox::dwio::common::SelectiveColumnReader::ensureValuesCapacity<int>(int, bool)
​# 4  void facebook::velox::dwio::common::SelectiveColumnReader::prepareRead<int>(long, folly::Range<int const*> const&, unsigned long const*)
​# 5  facebook::velox::dwrf::SelectiveStringDictionaryColumnReader::read(long, folly::Range<int const*> const&, unsigned long const*)
...
​# 22 start_thread
​# 23 __clone3
​
​======= Current Allocations ======
​Found 76 allocations:
​======== 1 allocations of 256.00KB total size ========
​# 0  facebook::velox::memory::MemoryPoolImpl::recordAllocDbg(void const*, unsigned long)
​# 1  facebook::velox::memory::MemoryPoolImpl::allocateZeroFilled(long, long)
​# 2  facebook::velox::dwio::common::compression::PagedInputStream::prepareOutputBuffer(unsigned long)
​# 3  facebook::velox::dwio::common::compression::PagedInputStream::readOrSkip(void const**, int*)
...
​# 26 execute_native_thread_routine
​# 27 start_thread
​# 28 __clone3
​
​======== 1 allocations of 127.96KB total size ========
​# 0  facebook::velox::memory::MemoryPoolImpl::recordAllocDbg(void const*, unsigned long)
​# 1  facebook::velox::memory::MemoryPoolImpl::allocateZeroFilled(long, long)
...

@netlify
Copy link

netlify bot commented Aug 12, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 9d7a58b
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/68a90f21fb6c040008585ca6

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 12, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79902261

@kletkavrubashku kletkavrubashku marked this pull request as draft August 12, 2025 05:50
@kletkavrubashku kletkavrubashku changed the title Adding threshold for logging memory pool allocations feat: Adding threshold for logging memory pool allocations Aug 12, 2025
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 12, 2025
Summary:
I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 12, 2025
…prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 12, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/velox that referenced this pull request Aug 13, 2025
…or#14437)

Summary:

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Differential Revision: D79902261
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79902261

kletkavrubashku added a commit to kletkavrubashku/velox that referenced this pull request Aug 13, 2025
…or#14437)

Summary:

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Differential Revision: D79902261
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79902261

kletkavrubashku added a commit to kletkavrubashku/velox that referenced this pull request Aug 13, 2025
…or#14437)

Summary:

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Differential Revision: D79902261
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79902261

kletkavrubashku added a commit to kletkavrubashku/velox that referenced this pull request Aug 13, 2025
…or#14437)

Summary:

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Differential Revision: D79902261
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79902261

kletkavrubashku added a commit to kletkavrubashku/velox that referenced this pull request Aug 14, 2025
…or#14437)

Summary:

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Differential Revision: D79902261
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79902261

kletkavrubashku added a commit to kletkavrubashku/velox that referenced this pull request Aug 14, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Differential Revision: D79902261
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 14, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Differential Revision: D80066283
@kletkavrubashku kletkavrubashku marked this pull request as ready for review August 18, 2025 18:56
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79902261

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 255da1a.

@kletkavrubashku kletkavrubashku deleted the export-D79902261 branch August 23, 2025 21:04
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 25, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 25, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 26, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Reviewed By: tanjialiang

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 26, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Reviewed By: tanjialiang

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 26, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Reviewed By: tanjialiang

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 26, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Reviewed By: tanjialiang

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 26, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Reviewed By: tanjialiang

Differential Revision: D80066283
kletkavrubashku added a commit to kletkavrubashku/presto that referenced this pull request Aug 26, 2025
…shold_bytes (prestodb#25750)

Summary:

I added threshold for logging memory pool allocations": facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure the threshold.

Reviewed By: tanjialiang

Differential Revision: D80066283
kletkavrubashku added a commit to prestodb/presto that referenced this pull request Aug 28, 2025
)

Summary:
I added threshold for logging memory pool allocations":
facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure
the threshold.

Differential Revision: D80066283
dan13bauer pushed a commit to dan13bauer/velox that referenced this pull request Sep 1, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 2, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
wypb pushed a commit to wypb/velox that referenced this pull request Sep 3, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/velox-exchange that referenced this pull request Sep 8, 2025
…or#14437)

Summary:
Pull Request resolved: facebookincubator#14437

We have a leak check in memory pool the prints all current allocations along with call sites.
In this diff I'm expanding that functionality and adding possibility to log that information once we reach configurable threshold. It's supposed to be used for debugging, when we want to know how exactly the memory has been used in particular memory pool. Adding this only for leaf nodes for now.

Reviewed By: tanjialiang

Differential Revision: D79902261

fbshipit-source-id: 98dfc2ed25e45fa3a7881fdaf71743677d012173
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 8, 2025
…stodb#25750)

Summary:
I added threshold for logging memory pool allocations":
facebookincubator/velox#14437
In this adding I'm adding corresponding session property to configure
the threshold.

Differential Revision: D80066283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants