Current time: 05-24-2024, 07:56 AM Hello There, Guest! (LoginRegister)


Post Reply 
Reducing memory usage
Author Message
pete Offline
Junior Member
*

Posts: 14
Joined: Dec 2009
Reputation: 0
Post: #6
RE: Reducing memory usage
BeNe, your suggestion worked a treat, thanks.

dcreation, in theory you're right but in my case the VPS I'm using doesn't have swap space so all virtual memory equals virtual machine memory. My limit is 1GB and my server is often dangerously close to that mark. Not surprisingly, at times things stop working due to memory allocation errors.

With BeNe's help, I now reduce overall memory down to about 400mb.
(04-08-2010 10:24 PM)kilburn Wrote:  First of all, assuming that you have no SWAP space, the virtual memory (VIRT) used by a process is completely irrelevant.

Just when I thought I could understand this stuff someone throws a spanner in the works.

What is virtual memory then?

I mean, in C (and implicitly C++) we use malloc and free to manage the applications heap storage. Apart from the heap, there is stack space, code of the module itself and shared libraries, but combined, these would be a small fraction of the 144mb stated.

So I assume that a large portion of the 144mb has been allocated via [many calls to] malloc. In the absence of a swap device, where exactly would the OS put allocated memory?

I can only assume that the "no" in your comment is a typo. If I don't have a SWAP device, then surely virtual memory=physical memory (with the exceptions of shared code you mentioned), right?

If not, what is "virtual memory" in top's vocabulary?
(This post was last modified: 04-09-2010 07:59 PM by pete.)
04-09-2010 07:29 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Reducing memory usage - pete - 04-07-2010, 11:27 AM
RE: Reducing memory usage - BeNe - 04-07-2010, 03:25 PM
RE: Reducing memory usage - pete - 04-09-2010 07:29 PM
RE: Reducing memory usage - pete - 04-08-2010, 03:11 PM
RE: Reducing memory usage - dcreation - 04-08-2010, 08:58 PM
RE: Reducing memory usage - kilburn - 04-08-2010, 10:24 PM
RE: Reducing memory usage - kilburn - 04-10-2010, 03:27 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)