Skip to content

Process and memory leak  #35

@Treverix

Description

@Treverix

First, thanks for that library, I use it with an electron application to connect to multiple Sybase ASE databases and it works like a charm, also with the jdbc4 driver.

I've observed a process leak. My setup closes connections after 5 mins and recreates them on demand. Each disconnect kills the java process and I expect that no processes are running after I close my application.

This is not the case. When we spawn the Java application like shown in the official example

spawn('java',["-jar",this.pathToJavaBridge, this.host, this.port, this.dbname, this.username, this.password]);

then it creates 2 processes on my WIN10 system, one for java and second one for C:\Program Files\...\java.exe. The kill now only removes the first process (java), the real process is kept alive.

I'm not sure if this is a special behavior for WIN10, but it can be avoided, if we spawn like this:

spawn(path.join(process.env.JAVA_HOME, 'bin/java.exe') ,["-jar",this.pathToJavaBridge, this.host, this.port, this.dbname, this.username, this.password]);

This, for sure, requires the env variable JAVA_HOME to be set. The solution is to give the full file path to the java executable so that only one process is created and that one is properly killed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions