Skip to content

OutOfMemory() method #10

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

Closed
benloh opened this issue Sep 10, 2024 · 2 comments
Closed

OutOfMemory() method #10

benloh opened this issue Sep 10, 2024 · 2 comments
Assignees

Comments

@benloh
Copy link
Collaborator

benloh commented Sep 10, 2024

After merging #7,

In spite of having plenty of memory (e.g. here there's 582MB)...

screenshot_1704

Opening a saved graph always results in an out of memory error:

screenshot_1703

To Replicate

  1. Go to http://24.144.94.149/manage (inquirium server)
  2. Check memory > 256MB free
  3. Click "demo" or "monaug19" to open saved graph
  4. Ran out of Memory. Can't start the graph. error.

Investigating

Maybe I'm reading this wrong, but doesn't OutOfMemory() always return true?

/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** Used to check if we have enough memory to start a new node process
 *  This is used to prevent node from starting too many processes.
 */
function OutOfMemory() {
  const bytesToMB = 1024 * 1024;
  let free = os.freemem() / bytesToMB; // mb
  const warnMem = SYSMEM_MIN;
  const critMem = SYSMEM_MIN / 4;
  const low = free < critMem;
  const warn = free < warnMem;
  if (low) return `**CRITICAL** (< crit fail buffer ${critMem}MB)`;
  if (warn) return `**WARNING** (< mem buffer ${warnMem}MB`;
  return `OK (>${SYSMEM_MIN}MB free)`;
}

So while RenderMemoryReport() is correctly using OutOfMemory() to retrieve a message,
m_RouterLogic():833 is relying on OutOfMemory() to return true or false.

@dsriseah
Copy link
Contributor

I'll add a specific memory check and separate this from MemoryReport.

@benloh
Copy link
Collaborator Author

benloh commented Sep 11, 2024

Confirmed fixed.

@benloh benloh closed this as completed Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants