What is the solution to a memory-intensive bug that caused your PC to stop working during the operation test?

Asked 2 years ago, Updated 2 years ago, 83 views

We are developing using node.js, and when we moved selenuim during the operation test, it consumed a lot of memory due to bugs in selenium or the test site, and the PC was stuck for about 22 hours.

How can I resolve my PC's inoperable due to excessive memory usage?
If possible, I would like to solve the problem without erasing existing unsaved data such as reboot.
The operating system is Windows 7 and the memory is 8 gigabytes.

This time it's Windows, but if there are any other solutions that can be used in os, I'd appreciate it if you could reply for later study.

Also, if there are any software development techniques or tools that can prevent inactivity due to excessive memory, I would like to try to avoid similar problems, so please reply.

I'm sorry to be late at night. I look forward to hearing from you.

linux windows node.js

2022-09-30 18:17

2 Answers

This is a situation where thrashing occurs as a result of the memory consumption far exceeding the actual amount.

Let's give up that "memory-intensive software" unsaved data (it may have been saved after a few years, but it's faster to re-enter it after reboot).

If you have unsaved data such as other processes, such as editors, you should be able to recover and save operations by forcing the cause process to terminate.

However, if the actual machine is in this situation, it is virtually inoperable, and if it is an Euler, it gives up and turns off (Ctrl+Alt+Del opens the task manager, but one operation can take several hours).If you can wait, it's worth a try.)

To prevent thrashing

  • On Linux operating systems

The command ulimit allows you to limit the resource limits of a process.You should limit the amount of memory beforehand.

  • Linux/Windows Common

Use virtualization software (such as Hyper-V) to run the "memory-based program" on the virtual machine.Only virtual machines die from thrashing, so you can force shutdown from the real machine.It is important not to allocate all physical resources to the virtual machine.

  • On the Windows operating system

I heard there used to be a Windows System Resource Manager, but it has been deleted now.It seems that you should follow the steps above (Hyper-V).


2022-09-30 18:17

How can I resolve my PC's inoperable due to excessive memory usage?

In Task Manager, lower the priority for CPU-intensive processes.

Example Task Manager

Right-click the process that is consuming the CPU from this Details tab and click
Set the priority to

low.

priority

If successful, the process that kept the entire system frozen will be less prioritized
It's easier to do.

Not all processes can change priority, and

if the slow down is caused by virtual memory swapping due to lack of memory It doesn't work that much effect.
Determine by looking at CPU consumption and disk access.

I want to solve the problem without erasing the existing unsaved data.

I think it will be difficult because I don't know how the application keeps internal memory.
It will be difficult unless the app stores the data regularly.

You can select a process from Task Manager to retrieve the memory state of the application running in Create Dump File.
If you open a dump file that you retrieved from Visual Studio, you will see where the process was running.
However, I think it is difficult to extract unsaved data from this.
I think you can check the core dump in the binary editor and find a few strings that you can use.

I'm not familiar with node.js, but when I looked it up, I attached it to the running process
It seems possible to see the value of the variable.

https://stackoverflow.com/questions/24927233/nodejs-process-hang-how-could-i-debug-it-or-collect-dump
Now
https://www.npmjs.com/package/why-is-node-running
or
https://stackoverflow.com/questions/1911015/how-do-i-debug-node-js-applications/16512303#16512303

Software development techniques and tools to avoid memory loss.

First of all, you will need to investigate the problem on the app side.

Debugging node.js to investigate the cause
Try attaching and debugging processes running in Visual Studio.
Without the source code, it may be difficult to determine the cause...

https://docs.microsoft.com/ja-jp/visualstudio/javascript/debug-nodejs?view=vs-2019

https://nodejs.org/api/debugger.html

SysInternals also has a tool that automatically retrieves dumps when they lock up.
https://docs.microsoft.com/en-us/sysinternals/downloads/procdump
I can't use it this time because I need to set it up before starting the application, but for your information...


2022-09-30 18:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.