Programming :: Write A Script That Can Show Me Total Memory Vs Used Memory?

Apr 13, 2010

How do I write a script for my Linux that can show me total memory vs used memory and have it email me results if it's over 70 percent?

View 2 Replies


ADVERTISEMENT

Programming :: Write A Script To Calculate The Total Amount Of Installed Memory?

Apr 4, 2011

I am trying to write a script to calculate the total amount of installed memory to use during an anaconda kickscript, so the swap file is created at 2 x the installed memory. I so far have the amount of installed RAM DIMMS but need a way to total them up and produce a varible I can use in the pre section of the install.

Code:

dmidecode -t 17 | grep Size | awk ' { print $2 }'
Output:
2048
2048

Note: on some servers there could be from 1 DIMM up to 16 DIMMS installed so the script needs to be able to handle this. I also can not use bc as it does not exist during the install stage. I am guessing I need a while loop to do this and use expr but do not know where to start for this logic.

View 3 Replies View Related

Programming :: Total Amount Of Allocated SHM Memory?

Aug 25, 2010

Is there an easy way in C to get the total amount of allocated SHM memory on a machine?

View 7 Replies View Related

Programming :: Write A Value From A Specific Memory Location In C?

Jul 13, 2010

How to write a value to a specific memory location in C language and how to access the same value ?
I am trying the same on fedora linux and i am trying to write the value to the 32-bit address.

View 2 Replies View Related

Programming :: Write() To Disk Causes Memory Leak?

Oct 26, 2010

I have encountered this problem of memory usage is increasing as the during the my program is being run until 1Mb is left then it stays at that.A part of the program is this:

Code:
#define WRITE_BUF_SIZE (1024*1024)
void post_data(const void *data, unsigned long size)

[code]....

View 3 Replies View Related

Programming :: Shared Memory - Should They Show The Same Address?

Mar 17, 2010

So I'll try to be brief and to the point here: I've got a couple of C / C++ apps that communicate with one another via shared memory. These worked completely fine until.. well, about twenty minutes ago when I finished making some network card changes and suddenly, I've got a weird problem going on. At one point, Parent app waits for Child app to set a boolean indicating it's finished initialization. This worked fine the last time I ran this app up (a few days ago). But right now, the shared flag never seems to get triggered (I've added a printf("Waiting..."); in Parent app until the flag is set). All the code leading up to it being set in Child app seem to be running smoothly, so I tried spitting out the addresses of the shared memory locations. The addresses mapped by Parent app and Child app are different; this seemed odd, so I went back and wrote a simple miniature app that just opened a shared structure on my own box, and I get the same thing - different addresses - but the miniature apps work just fine.

Is it normal for a shared memory space to be mapped to two different addresses across two processes?

If so, does anyone have any idea what might be the issue at hand with my Parent / Child app scenario? The Child creates the shared memory, the Parent has a wait before it opens it, and if it doesn't exist should fail (opening with PROT_READ | PROT_WRITE)... it doesn't fail so it's evidently there.

All of this worked until literally just a few hours ago and I made some changes to my network cards, and I can't even imagine how that could have changed whether or not shared memory mapping worked...

View 2 Replies View Related

Programming :: Memory Leaks - Glibc Detected - ./SuffixTree: Malloc() - Memory Corruption - 0x00

Mar 21, 2011

I am new to C and linux. My code below does arbitary writes but I cant figure out where or how it does it.

I am calling the insertNode() function with seq = 'MISSISSPPI$' and alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ$'

Code:

Weird behaviour I should mention is that when I check for NULL pointer in node->child[index], the unassigned values are not null anymore, they point to arbitary memory.

View 12 Replies View Related

Programming :: SHM Memory Counted As Cache Memory With Kernel 2.6.18?

Aug 25, 2010

Is that possible that SHM shared memory is counted as cache memory on Linux with kernel 2.6.18?If find it really odd since this memory is not file backed, but I have a piece of code that loads data using shm_open+mmap, and it generates an amount of cache memory in /proc/meminfo that corresponds exactly to the amount of shared memory (I load that data from a file but I am using posix_fadvise(fd,0,0,POSIX_FADV_DONTNEED) to ensure this file is not cached and I made sure that it is working as expected). As far as I know SHM memory was not tagged as cache memory with kernel 2.6.9.If it is the case it is really unfortunate since normally cache memory can be considered to be part of the "available" memory since it can be flushed promptly but this is clearly not the case with SHM memory... Is there an easy way to get the total amount of used SHM memory on a system?

View 4 Replies View Related

Programming :: Write Script To Look For The Presence Of Memory Allocation Calls Without Corresponding?

May 14, 2011

I need to write script to look for the presence of memory allocation calls without corresponding calls to free the memory

View 5 Replies View Related

General :: Vmstat's Total Memory Statistic?

Sep 20, 2011

I am analyzing memory usage on a Linux system. When I run vmstat -s, I see the following:

waffleman@waffle-iron:~$ vmstat -s
3549184 K total memory
3206708 K used memory
1918012 K active memory
1037320 K inactive memory
342476 K free memory

[Code]...

I know the system has 4096 MB of RAM installed, but why does it show only 3466 MB? Can this be interpreted as total "available" memory? Perhaps the missing 630 MB is being used by the kernel and cannot paged out?

I also tried this on on an Embedded Linux system and saw a similar result. The DRAM chip has 128 MB, but only 124 MB shows up in vmstat.

View 1 Replies View Related

General :: Noticed That The Total Used Memory A Lot Higher Than Sum Of RSS?

Jul 9, 2010

i got a RHEL 5.2 machine.and i noticed that the total used memory(as shown in "free" command) is 3GB higher thanthe sum of RSS size of all processes(collected using "ps aux").i know that its not suppose to be exact because RSS counts ultiple times shared memory (so actually it suppose to be higher than the used memory).the server runs apache which runs a pretty heavy php program.my suspicion is that its memory leak?

View 14 Replies View Related

Slackware :: Total Memory Being Reported Incorrectly?

Jan 20, 2011

I'm running 13.1 on a Dell Latitude D630 with 4GB of RAM. My problem is that Slackware doesn't seem to see all of the available memory. Here are the #s being reported (just including pertinent #s rather than all output)...

Code:
free -m
total: 3546

[code]...

View 14 Replies View Related

General :: Calculate Total Memory Consumed By User?

Sep 20, 2010

is there a way to calculate the total memory consumed by user ?

View 12 Replies View Related

Hardware :: RHEL5.3 Is Not Showing Total Physical Memory?

Aug 27, 2010

I have rhgel5.3 installed on IBM blade server having 16 GB of physical memory. But it showing only 4GB.

#cat /proc/meminfo
#free -m
#top

[code]...

View 11 Replies View Related

General :: Find Total Memory Usage Of A Program?

Sep 22, 2010

I wrote a program that multiplies 2 matrices using multi-threads and another one using multiple processes and shared memory. Both in C.I need to find the total memory usage of these programs. I know of the top command, but when my matrices are relatively small they don't even show up on top because they complete so fast, how can I find the memory usage for these instances?Also, how can I find the total turnaround time of my programs?

View 3 Replies View Related

Server :: Find Total Apache Memory Usage?

Sep 12, 2010

Top only show the memory usage for individual processes. Apache often runs hundreds of processes, each of which may use only a small amount of memory, however the total memory consumed by all apache processes can be fairly large.Is there a way to see the total memory usage for all apache processes?

View 7 Replies View Related

Server :: Calculate The Total Amount Of Memory Used By The System?

Jul 15, 2010

I want to calculate the total amount of memory used by the system, Someone please confirm if the below formula is correct.Quote:

((memUsed-mebBuffers-memCached)*100)/memUsed => totalMemoryUsed%
Code:
free -o
total used free shared buffers cached
Mem: 8167004 8115292 51712 0 87680 1444676
Swap: 8388584 3252996 5135588
((8115292-87680-1444676)*100/8115292) => 81%

As per the above calculation 81% of memory is used.Is this correct? and if so Am I running out of memory?what is the limit in % that I should maintain for a better performance?

View 3 Replies View Related

General :: Application Virtual Address Space Memory Allocation - Memory Does Not Get Free

Apr 20, 2010

I am using malloc and frees a lot in my program. It shows its allocated but when i remove it doesnt show as the memory is removed(I am using the top command to view VIRT memory usage). If this continously grows what would happen to my program (Will it go out of memory?)

View 4 Replies View Related

Fedora Hardware :: Checking Computer Memory - Specification Shows 2 GB Of Memory Instead Of GB

Feb 7, 2011

Fedora 14 xfce
HP Mini 210

I am looking to buy some memory for my netbook. Currently I have 1 GB of DDR3 memory. However, the specification says that 2 GB of memory is the max. However, when I do the following it says that 4GB is the max:

[Code].....

View 3 Replies View Related

General :: Ubuntu - Memory Full, Process Memory Usage Doesn't Add Up In Top?

Mar 18, 2011

I have a computer with 16GB of ram. At the moment, top shows all the RAM is taken, (NOT by cache), but the RAM used by the various processes is very far from 16GB.I have seen this problem several times, but I don't understand what is happening.My only remedy so far has been to reboot the machine.

View 1 Replies View Related

Server :: Clear Cache Memory ( RHEL 5.1 ) As It Consumes Almost 100% Physical Memory?

Jan 11, 2010

let me know how to clear cache memory ( RHEL 5.1 ) as it consumes almost 100% physical memory.

View 3 Replies View Related

Software :: Free Database That Has Low Memory Usage And Innodb And Memory Like Engin

May 3, 2011

I am looking for free database that has low memory usage and innodb and memory like engins that has C API and support trigger and client/server support for using in embedded linux systems.

View 8 Replies View Related

OpenSUSE Install :: Virtual Memory / Resident Memory Of Server?

Feb 3, 2010

we found that if we use 'top' to show the memory usage of a server (SuSe Linux 10), we can get virtual memory usage as well as 'Resident memory' usage. For virtual mem or a particular process, it is around 1.1GB, which is large but for resident memory, it only consumes 300MB. Are there anyone who knows what the differences are? I would also like to know whether the difference (1.1GB - 300MB) = 800MB are actually available for use by other applications in the system.

View 1 Replies View Related

Ubuntu :: Memory Error When Installing Python - Cannot Allocate Memory

Apr 19, 2010

I get this error when I run "sudo apt-get install python-software-properties"

Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
fork failed: Cannot allocate memory
E: Sub-process /usr/bin/dpkg returned an error code (2)

I'm trying to install deluge via ssh and my vps has 512mb ram and is only using 11% of it prior to running the code.

View 2 Replies View Related

Hardware :: Why Dmesg / Grep Memory Gives Two Different Physical Memory Amounts

Oct 20, 2010

I am monitoring physical memory in a server I administer, and my hardware provider told me they had increased physical memory size to 4Gb... However, using several tools (free -m; top; dmesg | grep Memory; grep MemTotal /proc/meminfo I discovered that I actually have 3Gb, not 4... But, my doubt comes from the fact that dmesg | grem Memory tells me I have 3103396k/4194304k available The first number is effectively 3Gb, but the second one, is 4! so, why I am looking at this two different numbers?

View 1 Replies View Related

Ubuntu :: Memory Leak / Some Process Eating All Memory

Jan 29, 2011

I have had a fresh install of Ubuntu 9.10 and installed some software after that.Since third some, some process is eating half of my memory.I have checked processes running in system manager but everything is normal.Maximum is consumed by compiz which is about 26 mb, seems very normal.I did restarted my computer several times, and in the start for 5 mins, its fine after that again my cpu fans runs at very fast speed and my one cpu is used up 95 % (I have dual core).Please help me out, this invisible thing is driving me crazy.I am attaching my htop screen shot (sorted by cpu %), now the cpu is not used by completely but fan is still struggling hard and fast.

View 9 Replies View Related

Software :: Accessing Memory Address Outside Standard Memory

Nov 22, 2009

I am writing an application that wants to access periphals registers outside the standard (allowed) memory area.

Doing so gets me "segmentation fault".

I know, this is natural behaviour.

One way of getting around this is writing the module which has to be loaded by linux. I will consider this some time later.

For now, I want to come to some quick result and allow linux or gcc compiler to write to those memory areas of periphals. Is there a direct way to do so?

View 3 Replies View Related

Debian :: Show Only 3.2G Instead Of 4G Memory In Lenny - Normal?

Apr 27, 2010

I upgraded my MB, CPU and memory to 4G. I am running 32 bit Lenny. In the BIOS, I see about 3.8G memory. However, in Lenny I see only about 3.2G. Is it normal? Is there something I need to do to get the most out of memory this size, like setting highmem?

View 8 Replies View Related

Red Hat / Fedora :: Read Or Write At Specified Memory Location On SD Card

Dec 10, 2010

I am new to linux at driver level. I want to read/write at specified memory location in microSD card in linux. I do not want to used SD card with any file system. How to do that. My linux distribution is Fedora13.

View 3 Replies View Related

General :: Write *.iso Image Files Onto USB Memory Stick?

Sep 6, 2009

Can you please do me favor and let me know how can I write the *.iso image files onto USB memory sticks as if we burn them into CD and thus making bootable CD to boot from ? Is there any command under Linux for this purpose ?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved