What could be the reason for huge memory values displayed on system activity table?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think that it is extremely likely that your programs contain a programming bug ... possibly caused by "circular memory references" or somesuch ... which are preventing their memory-manager's "garbage collector" from working properly.
This is causing a classic "memory leak."
Linux is responding by swapping-out the information, which will never again be referenced. But, in so doing, it is gradually consuming swap space. Eventually, it will "OOM-kill" your process for this offense, but it will be in fairly desperate straits by the time that it does so.
Your software has a bug in it. Find it and fix it.
In most high-level programming languages, the "garbage collector" periodically sweeps through memory to reclaim memory that is no longer used. But it cannot do this if a "chain" of data structures refer to one another and if none of those self-references have been so-called "weakened." The exact resolution to your problem varies by whatever language you happen to be using, but the principles are the same.
This is not a Linux problem at all. This is a memory leak ... a bug in your application(s).
I think that it is extremely likely that your programs contain a programming bug ... possibly caused by "circular memory references" or somesuch ... which are preventing their memory-manager's "garbage collector" from working properly.
This is causing a classic "memory leak."
Linux is responding by swapping-out the information, which will never again be referenced. But, in so doing, it is gradually consuming swap space. Eventually, it will "OOM-kill" your process for this offense, but it will be in fairly desperate straits by the time that it does so.
Your software has a bug in it. Find it and fix it.
In most high-level programming languages, the "garbage collector" periodically sweeps through memory to reclaim memory that is no longer used. But it cannot do this if a "chain" of data structures refer to one another and if none of those self-references have been so-called "weakened." The exact resolution to your problem varies by whatever language you happen to be using, but the principles are the same.
This is not a Linux problem at all. This is a memory leak ... a bug in your application(s).
The original OS had some bugs .. it had some problems too .. during these years i have fixed them.
My own software also are not complete or perfect! Not at all! I and my computer are evolving gradually! And i will monitor and test my software in the future too! But! I am not sure about memory leakage .. because:
Total memory usage is not more than few hundred mbs and swap has no values more than 2.7 mbs .. these values can not comprise such a huge values
I have posted this question in the general forum which is related to any software or hardware problem or question .. so may be it is not related to Linux! I am also not sure if my system is still Linux! This is because of a lot of changes and developments made ..
I use the code: using namespace std; in all my programs i also use clear and skipgarb functions in the beginning of my codes.. and i use g++ or make to compile .. my scripts are or were not in an orderly manner ..
Finally i do not consider it a problem .. i like high memory values even if virtual! So! This is just a question to add to my knowledge by getting answers
Thank you!
Irajjs, all you're really doing here is showing to the world (and to your boss) that you've had a memory-leak problem on your system for nearly a month and that you've done nothing to figure out how to solve it yet. All that you can think to do is to take pictures of it and to post them for viewing by people who really don't have any reason to care. (And, we've seen it before – and we fixed it.)
If you can't figure it out for yourself, ask your boss to assign a more-experienced co-worker to help you. This software has probably been buggy in this way for a very long time. C++ has a very different approach to memory allocation and programmers who are used to other languages often make mistakes that cause leaks. If you see that the virtual memory space is continuously growing, but that the working-set size is not continuously growing, then, "you have a leak."
I regret having said this entire post.
Last edited by sundialsvcs; 02-20-2018 at 07:00 PM.
Irajjs, all you're really doing here is showing to the world (and to your boss) that you've had a memory-leak problem on your system for nearly a month and that you've done nothing to figure out how to solve it yet. All that you can think to do is to take pictures of it and to post them for viewing by people who really don't have any reason to care. (And, we've seen it before – and we fixed it.)
If you can't figure it out for yourself, ask your boss to assign a more-experienced co-worker to help you. This software has probably been buggy in this way for a very long time. C++ has a very different approach to memory allocation and programmers who are used to other languages often make mistakes that cause leaks. If you see that the virtual memory space is continuously growing, but that the working-set size is not continuously growing, then, "you have a leak."
I do not want to argue but i have to explain because i do not want to be considered as ignorant!
I think your judgement and understanding about me or my software is based on wrong or incomplete data and information and being hasty!
Anyhow i am not employed anywhere ..
Subject is related to my PC ..
I am just interested in computer and programming ..
Even if i accept your idea about that being a memory leakage it is no problem at all! Because i am not connecting to Internet this leakage will not harm anyone!
Even it is an advantage because i think nearly all programs in a computer should share their memory to enhance integration and i am intentionally trying to get to a point where all my software are integrated!
Unfortunately whenever type command "free" i get this output too! :
Shared memory 0
So if you do not care as you said just forget it! Otherwise you may study my recent posts in: LQ and in SL and in instagram
I do not expect any one to spend their time unless they are interested!
Regards
So if you do not care as you said just forget it! Otherwise you may study my recent posts in: LQ and in SL and in instagram
I do not expect any one to spend their time unless they are interested!
Regards
All right, Irajjs, I'm going to own up to my ill-considered and insufferably-snarky words in the previous post, and herewith officially eat them.
I owe you a sincere and public apology, and, here it is.
I maintain my suspicion that the root cause of the problem is that your software is not releasing all of the memory that it dynamically allocates. Debugging tools might be able to assist you in finding them, especially if they can point out "abandoned" memory blocks having content that your recognize.
This is not the same as "shared memory."
All memory used by a user-side process is virtual: the process perceives that it has memory all to itself, and that it can even request ... and, obtain ... more "memory" than the underlying machine actually has. The operating system manages this trick in-part by recognizing what portions of memory are actively being used right now, and which are not. (It will commit physical resources to the instantaneously-active areas, the so-called "working set." The rest will be swapped-out, there to be forgotten unless referenced again.) A process can run for a very long time, with its "virtual memory size" growing bigger and bigger, when there is a "leak."
The C++ language does not have a "garbage collector," as many other languages do. You are responsible for cleaning up everything. The most likely culprit just might be an omission in the destructor of some class that your program instantiates and uses constantly. Start with the most-often used class and carefully desk-check the source-code of its constructor and destructor.
I maintain my suspicion that the root cause of the problem is that your software is not releasing all of the memory that it dynamically allocates. Debugging tools might be able to assist you in finding them, especially if they can point out "abandoned" memory blocks having content that your recognize.
This is not the same as "shared memory."
All memory used by a user-side process is virtual: the process perceives that it has memory all to itself, and that it can even request ... and, obtain ... more "memory" than the underlying machine actually has. The operating system manages this trick in-part by recognizing what portions of memory are actively being used right now, and which are not. (It will commit physical resources to the instantaneously-active areas, the so-called "working set." The rest will be swapped-out, there to be forgotten unless referenced again.) A process can run for a very long time, with its "virtual memory size" growing bigger and bigger, when there is a "leak."
The C++ language does not have a "garbage collector," as many other languages do. You are responsible for cleaning up everything. The most likely culprit just might be an omission in the destructor of some class that your program instantiates and uses constantly. Start with the most-often used class and carefully desk-check the source-code of its constructor and destructor.
-i do not consider that a problem
-i do not think about that as being bug
- i just do not fully understand that because neither system nor my software do not explain about whatever they are doing!
I do not expect you to refer me to pre-made tools .. i think real programmers should solve their own problem by creating and using their own codes!
The situation is a little more complicated .. maybe!
Possibly my software are acting independently!
Because they are not supported or understood by the original OS software .. which are fully dependent on parental sites!
Now i can not talk more clearly because the situation is not clear enough!
I will not clean everything but i will try to develop my work!
And i welcome any helping suggestion in this direction
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.