Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: BCP import memory leak with varchar(max) #2462

Closed
1 task done
staticlibs opened this issue Apr 3, 2024 · 1 comment
Closed
1 task done

[Bug]: BCP import memory leak with varchar(max) #2462

staticlibs opened this issue Apr 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@staticlibs
Copy link
Contributor

What happened?

This issue is similar to #2455, there seems to be a leak in processing Partially Length-prefixed (PLP) incoming records. Memory is allocated in MessageContext, so it is released after BCP import finishes. Still can be a problem when importing large files.

Excessive memory usage can be shown using BCP import with a table like this:

create table tab1 (col1 varchar(max))
insert into tab1 values('foobar')
insert into tab1 values(null)
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
insert into tab1 select * from tab1
select count(*) from tab1
> 2097152

Will submit a PR.

Version

BABEL_3_X_DEV (Default)

Extension

babelfishpg_tds

Which flavor of Linux are you using when you see the bug?

Fedora

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@rohit01010
Copy link
Contributor

PR's are merged, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants