Skip to content

MaxDNG/oracle-memory

Repository files navigation

Setup

Prerequisites

Nodejs v20.15.1 or higher Oracle instantclient v23.7.0.25.01 (release 5.4.17-2136.336.5.1.el8uek.x86_64)

Table creation

Create a table in your database:

create table load_test (
   foo               varchar2(64) not null,
   bar               number(15,0) not null,
   baz               varchar2(4000) not null
);

Oracle Credentials

Set your credentials in the index.mjs

const USERNAME = 'YOUR_USERNAME';
const PASSWORD = 'YOUR_PASSWORD';
const DB_CONNECTION_STRING = 'YOUR_DB_CONNECTION_STRING';

NPM Packages

Install the required packages:

npm i

Running the script

Then run the script

node index.mjs

Once run, you will see output similar to the content of example-run.log.

As you can see, the process starts with a RSS of 66MB and a heap of 13MB. When all insertions have complete and node has freed heap, the RSS is at 97MB and the heap is 10MB. Thus, in the process, 30MB of RSS has not been freed.

To get further information, you can run the script with valgrind to see what is going on with the memory.

valgrind --leak-check=full --track-origins=yes --log-file=valgrind.log node index.mjs --skip-timeout

An example of the output is in the valgrind.log file.

As you can see, a significant amount of bytes are lost in the process, and a lot seems to be related to instantclient binaries.

Now, I'm no expert in C/C++ so maybe I'm mislead by the output.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published