@@ -120,6 +120,22 @@ variants, but these typically fall into two categories:
120120 arguments (this is typical of the :ref: `array builders <cpp-api-array-builders >`
121121 and :ref: `buffer builders <cpp-api-buffer-builders >`).
122122
123+ Controlling and restricting memory allocation
124+ ---------------------------------------------
125+
126+ By construction, many Arrow C++ APIs can allocate large amounts of memory, depending
127+ on their input parameters. Arrow C++ allows customizing the memory allocator for
128+ such large data areads through the :ref: `MemoryPool <cpp_memory_pool >` interface.
129+
130+ You can therefore implement a MemoryPool class enforcing the restrictions
131+ of your choise (for example to limit the total number of allocated bytes), and pass
132+ it to any Arrow C++ APIs you use.
133+
134+ .. note ::
135+ Unlike memory used for Arrow data, smaller metadata structures (such as field
136+ names, etc.) instead rely on the C++ standard library allocators for convenience.
137+ They will therefore be invisible to the MemoryPool memory accounting.
138+
123139Ingesting untrusted data
124140========================
125141
@@ -144,6 +160,13 @@ from an untrusted source), you **must** follow these steps:
1441602. If the API returned successfully, validate the returned Arrow data in full
145161 (see "Full validity" above)
146162
163+ Furthermore, both the IPC and the Parquet format allow for powerful forms of
164+ compression, and can therefore exhibit large expansion factors when reading.
165+ If you need to guard against potential denial-of-service attacks that would
166+ exhaust available memory, we recommend you enforce memory allocation limits
167+ using a dedicated MemoryPool implementation (see "Controlling and restricting
168+ memory allocation" above).
169+
147170CSV reader
148171----------
149172
0 commit comments