mirror of https://github.com/citusdata/citus.git
It turns out that TupleDescGetAttInMetadata() allocates quite a lot of memory. And, if the target list is long and there are too many rows returning, the leak becomes appereant. You can reproduce the issue wout the fix with the following commands: ```SQL CREATE TABLE users_table (user_id int, time timestamp, value_1 int, value_2 int, value_3 float, value_4 bigint); SELECT create_distributed_table('users_table', 'user_id'); insert into users_table SELECT i, now(), i, i, i, i FROM generate_series(0,99999)i; -- load faster -- 200,000 INSERT INTO users_table SELECT * FROM users_table; -- 400,000 INSERT INTO users_table SELECT * FROM users_table; -- 800,000 INSERT INTO users_table SELECT * FROM users_table; -- 1,600,000 INSERT INTO users_table SELECT * FROM users_table; -- 3,200,000 INSERT INTO users_table SELECT * FROM users_table; -- 6,400,000 INSERT INTO users_table SELECT * FROM users_table; -- 12,800,000 INSERT INTO users_table SELECT * FROM users_table; -- making the target list entry wider speeds up the leak to show up select *,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,* FROM users_table ; ``` |
||
---|---|---|
.. | ||
backend | ||
include | ||
test/regress |