-
Notifications
You must be signed in to change notification settings - Fork 41
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
Buffer Memory Increases when Polling for messages #156
Comments
I can't see any leak in the GetSync processing. I wrote a program that does the same as you describe, and the buffer that gets passed to the C MQGET function is identical on each iteration. How much do you think is leaked on each loop? The 100K of the data buffer or something else (eg the size of the MQGMO structure, if you are allocating a new GMO every time). |
Hi @ibmmqmet , I'm sorry for replying late on this. So, I was looking at the values reported under I'm doing the following:
I tried to use the same instance of MQMD and MQGMO but I wasn't able to read the messages after the first run. Please let me know if you are looking at some other details. Thank you in advance. |
Hi @ibmmqmet , Did you get a chance to look into this? Thanks, |
I suspect this might be due to a known issue in the NodeJS engine. See nodejs/node-addon-api#1140 Doing "something" asynchronous in the application seems to be a solution as there is not a simple answer being provided by Node itself. I'll see if there's something suitable that can be done in GetSync, but that might break the promise of it being a synchronous function. So an app change might be needed. |
Thank you @ibmmqmet. Regarding the app change you mentioned, is it something that I should do at my end. If so, can you please guide me here? |
Hi @ibmmqmet,
We are using this module to fetch messages. The application is containerized. The application code is written as follows:
The size of the messages in our MQ is 100KB. We initialized the buffer with length 102400. Instead of allocating a new buffer for every read operation, we are initializing one at the time of connect and using it every time we try to read a message.
Problem
There seems to be a memory leak in the function call mq.GetSync which is causing the application memory to increase exponentially - since we have already initialized and using the same buffer memory for every read, I think this is unexpected.
Can you please help me here?
The text was updated successfully, but these errors were encountered: