How to solve the memory overflow problem and what to do if the memory overflow is done?

Updated on number 2024-03-22
1 answers
  1. Anonymous users2024-02-07

    There are many ways to solve it, let's talk about the following points.

    The first step is to modify the JVM startup parameters to increase the memory directly. (Don't forget to add the -xms, -xmx parameters.) )

    The second step is to check the error log to see if there are any other exceptions or errors before the "outofmemory" error.

    The third step is to conduct a walk-through and analysis of ** to find out the possible occurrence of memory overflow.

    location. There are many causes of memory shortage and memory overflow, and the common ones are as follows:

    1.The amount of data loaded in memory is too large, such as fetching too much data from the database at once;

    2.There is a reference to the object in the collection class, which is not cleared after use, so that the jvm cannot be **;

    3.** There is an endless loop or a loop that produces too many repetitions of the object entity;

    4.bugs in third-party software used;

    5.The memory value of the startup parameter is set too small;

    The first step is to modify the JVM startup parameters to increase the memory directly. (Don't forget to add the -xms, -xmx parameters.) )

    The second step is to check the error log to see if there are any other exceptions or errors before the "outofmemory" error.

    The third step is to conduct a walk-through and analysis of ** to find out where the memory overflow may occur.

    Focus on the following points:

    1.Check whether a query to the database obtains all data at once. Generally speaking, if 100,000 records are fetched to memory at a time, a memory overflow may occur.

    This problem is relatively hidden, before the launch, there is less data in the database, which is not easy to cause problems, and after the launch, there is more data in the database, and a query may cause memory overflow. Therefore, try to use pagination for database queries.

    2.Check for dead loops or recursive calls in **.

    3.Check if there is a large circulation.

    Repeats the creation of new object entities.

    4.Check whether a query to the database obtains all data at once. Generally speaking, if 100,000 records are fetched to memory at a time, a memory overflow may occur.

    This problem is relatively hidden, before the launch, there is less data in the database, which is not easy to cause problems, and after the launch, there is more data in the database, and a query may cause memory overflow. Therefore, try to use pagination for database queries.

    5.Check whether collection objects such as lists and maps are not cleared after they are used up. Collection objects such as list, map, etc., will always have a reference to the object, so that these objects cannot be gc**.

    Step 4: Use the memory viewer to view the memory usage dynamically.

    There are many ways, which tells you three points 1, add another memory module.

    2. Uninstall the useless software in the system disk; 3. Hands-on settings: My computer right-click Properties-Advanced-Settings-Advanced to change the maximum value to multiple of your computer's memory.

Related questions
7 answers2024-03-22

You can try it again ** one, if it doesn't work, uninstall some unnecessary things, try again, maybe it's OK, in fact, my computer is not hello, but it has never been, you might as well uninstall something and try again. 、 >>>More

12 answers2024-03-22

When there is a problem in the marriage, it is necessary to think of a solution, to see what causes the marriage problem, whether it is personal behavior or ideology, or whether the three views of two people do not agree when they get along, and only by finding the cause can it be completely solved.

4 answers2024-03-22

This situation is generally software conflict, poisoning, driver failure, system failure, memory failure, etc., which can be resolved by following the following steps: >>>More

2 answers2024-03-22

Answer: [Original] Copying is strictly prohibited&. Friend! If you have a problem that you have solved in other ways, please say it for other friends to solve. Thank you! >>>More

14 answers2024-03-22

This doesn't matter, the system memory will only be borrowed when the graphics card does not have enough video memory.