Open boriborm opened 1 year ago
Can you add code to create the queue and add runnable code do the enqueues, so we know what's in the queue?
Queue is empty.
BEGIN
DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table => 'MSG_QT',queue_payload_type => 'RAW');
DBMS_AQADM.CREATE_QUEUE(queue_table => 'MSG_QT', queue_name => 'CLIENT_OUT);
DBMS_AQADM.START_QUEUE('CLIENT_OUT);
END
@pvenkatraman another task for you :)
Maybe bug in function dpiQueue_deqMany
When it run, then numMsgProps
changed to 0 (no new messages, queue is empty)
I run code below and no memory leaks
static bool njsAqQueue_deqManyAsync(njsBaton *baton)
{
njsAqQueue *queue = (njsAqQueue*) baton->callingInstance;
baton->msgProps = calloc(baton->numMsgProps, sizeof(dpiMsgProps*));
if (!baton->msgProps)
return njsBaton_setError(baton, errInsufficientMemory);
/*
if (dpiQueue_deqMany(queue->handle, &baton->numMsgProps,
baton->msgProps) < 0)
return njsBaton_setErrorDPI(baton);
*/
baton->numMsgProps = 0; // Empty queue imitation
return true;
}
Script in my first post output:
start
count: 0, rss: 60858368
count: 1, rss: 61128704
count: 2, rss: 61394944
count: 3, rss: 61394944
count: 4, rss: 61394944
count: 5, rss: 61394944
count: 6, rss: 61394944
count: 7, rss: 61394944
...
...
count: 1994, rss: 61669376
count: 1995, rss: 61669376
count: 1996, rss: 61669376
count: 1997, rss: 61669376
count: 1998, rss: 61669376
count: 1999, rss: 61669376
end
memory usage between 60858368 and 62414848
Thanks @boriborm will take a look.
Bug in dpiQueue__deq
when numMsgProps > 1 and payload is 'RAW', then run this function
status = dpiOci__aqDeqArray(queue->conn, queue->name,
queue->deqOptions->handle, numProps, queue->buffer.handles,
payloadTDO, queue->buffer.instances, queue->buffer.indicators,
queue->buffer.msgIds, error);
This function run OCI function OCIAQDeqArray
:(
When i change it to
/*
status = dpiOci__aqDeqArray(queue->conn, queue->name,
queue->deqOptions->handle, numProps, queue->buffer.handles,
payloadTDO, queue->buffer.instances, queue->buffer.indicators,
queue->buffer.msgIds, error);
*/
status = 0;
*numProps = 0; // Empty queue imitation
no memory leak
Thanks, working with another team member on this issue. Will update soon.
Is this problem solved in any specific version? Version less than 6 from here
@JoshuaCEnrico The memory profile with node-oracledb 6.x has changed slightly, because of the refactoring to use less C code in general, in addition to the newly introduced Thin mode. We will try to see if this can be reproduced in the 6.x version and get back to you.
@sharadraju The issue still exist, even in the v6.5.1
Platform: linux Node version: v14.17.6 Architecture: x64 node-oracledb version: 5.5.0 Oracle client version: 21.3.0.0.0
Crash
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
output: