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

It seems that there is a small memory leak in client application when multiple using isc_attach_database/isc_detach_database [CORE845] #1234

Closed
firebird-automations opened this issue Jul 5, 2006 · 11 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Vitaly (v6y)

@firebird-automations
Copy link
Collaborator Author

Modified by: Vitaly (v6y)

Version: 2.0 RC3 [ 10040 ]

Version: 2.0 RC2 [ 10032 ]

Version: 2.0 RC1 [ 10031 ]

Version: 1.5.3 [ 10028 ]

Version: 2.0 Beta 1 [ 10029 ]

Version: 2.0 Beta 2 [ 10030 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

assignee: Dmitry Yemanov [ dimitr ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Do you use local or remote connection string?

@firebird-automations
Copy link
Collaborator Author

Commented by: Vitaly (v6y)

> Do you use local or remote connection string?

Does not matter - it happens in both cases.
For tests I used the following code:
#⁠include <ibase.h>
#⁠include <string.h>
#⁠include <stdio.h>
#⁠include <time.h>
#⁠include <signal.h>
#⁠include <unistd.h>

isc_db_handle db = NULL;
ISC_STATUS_ARRAY status;
int ret;

int TERM=0;

void sigterm(int signal) {
TERM=1;
printf("Got INT or TERM signal\n");
}

#⁠define ERREXIT(status, rc) {isc_print_status(status); return rc;}

int main (void)
{

long long i=0;
signal(SIGTERM,sigterm);
signal(SIGINT,sigterm);

while(!TERM) {
if (isc_attach_database(status, 0, "localhost:employee", &db, 0, NULL))
{
ERREXIT(status,-1);
}
if (isc_detach_database(status, &db))
{
ERREXIT(status,-1);
};
i++;
printf("%i attaches/detaches\n",i);
usleep(10000);
}
signal(SIGTERM,SIG_DFL);
signal(SIGINT,SIG_DFL);
return 0;
}

Because of no dpb here, I used environment variables ISC_USER and ISC_PASSWORD to setup firebird login/password.

So, just after starting of my test, the 'top' programm showed following:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32636 root 15 0 4368 1948 1516 S 2.0 0.1 0:00.02 fbtst

After about 3500 ataches/detaches:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32636 root 15 0 4496 2072 1516 S 1.3 0.1 0:01.44 fbtst

After about 10000 ataches/detaches:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32636 root 15 0 4624 2292 1540 S 0.3 0.1 0:02.74 tst

fter about 12800 ataches/detaches:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32636 root 16 0 4752 2376 1540 S 0.3 0.1 0:02.95 tst

And so on.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

On Win32, running v2.0.0 I see no memory leak at all. Tried 6000 iterations, both IPC and TCP connections.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Alex, could you please try this test case? Maybe it's posix-specific.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Failed to reproduce mentioned memory leak for both 1.5.4 and 2.0.1 RC2.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Cannot Reproduce [ 5 ]

Fix Version: 2.0.1 [ 10090 ]

Fix Version: 1.5.4 [ 10100 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 11056 ] => Firebird [ 14239 ]

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