Programming :: Find Which Block Of Program Consume How Much Memory?

Apr 15, 2011

I am trying to run C++ program on linux.

My program consume a lot of memory so that the memory is used up fast and memory swap is very high.

I can find this by "ps" .

My program is long.

I need to find out which part of my program consume so much memory ?

View 1 Replies


ADVERTISEMENT

Ubuntu :: Can't Find Any Process That Consume Such Large Number Of Memory

Feb 23, 2010

I used 9.04 for months and it work fine before restarting my PC. After I restarted my PC, the memory consumption takes up to 4.2 GB after login. However, I cannot find any process that consume such large number of memory.

[code]....

View 3 Replies View Related

General :: Using Libcurl In C Program / Consume Webservices?

Feb 9, 2011

I have need to call webservices using libcurl through C program under ubuntu environment. Ho can I do this. I am unable to call web service using curl.

View 4 Replies View Related

Programming :: Core Dump - Right Memory Block To Be Freed

Nov 8, 2010

In one of our core dump we have the followings in the core back trace:

#0 0xb77bf947 in raise () from /lib/tls/libc.so.6
#1 0xb77c10c9 in abort () from /lib/tls/libc.so.6
#2 0xb77f56ba in __fsetlocking () from /lib/tls/libc.so.6
#3 0xb77fcf7f in mallopt () from /lib/tls/libc.so.6
#4 0xb77fd022 in free () from /lib/tls/libc.so.6

It occurred in a memory block free operation. From our analysis, there seems no issue relate the the memory block it self. The memory pointer pointed to the right memory block to be freed and the contents of the memory seems right (not corrupted), in one world, there is nothing obviously wrong. Does any one have any ideas what could be wrong when seeing about?

View 1 Replies View Related

General :: Ubuntu - Find Out Which Processes Consume Most Energy?

Aug 21, 2011

In Linux, is it possible to know which processes consume most battery energy at the moment?

View 1 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

Programming :: C Program - Getting The Raw Size Of A Block Device

Oct 16, 2010

How do you go about getting the raw size of a block device under Linux from within a C program? And I mean the raw size of the block device itself, not a file system that may or may not be installed on it. And I'd like to be able to get the raw size of any block device, from hard drives (e.g., /dev/sda) to LVM partitions (/dev/mapper/vg0-home) to loop devices to anything else that is a Linux block device.

View 3 Replies View Related

Programming :: Allocate Memory To A Program Before Execution?

Jan 3, 2011

I went to an interview last week and there was this guy who asked a simple question that i have been trying to solve for a couple of days. I tried google but i just cant get the search keywords right. The result were just useless. Well, the question is : "How can we allocate a limited memory to a process before we start its execution" well, the question is related to an X11 system so may be some flags must be set to limit its memory.

View 9 Replies View Related

Programming :: Manage Memory To Speed Up Program?

Nov 18, 2008

I wrote a program in lcc in windows and I have to write it in gcc in unix. In lcc there was an option to use more memory than the default for the stack. The following code is working in lcc but in gcc it gives segmentation fault:

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
int main()
{

View 11 Replies View Related

Programming :: Possible To Know The Amount Of Memory Used By A Program Before Running It?

Mar 3, 2009

I would like to know if there is a linux command to verify the amount of memory used by a program. The programs I am using were compiled with gfortran.

View 2 Replies View Related

Programming :: Memory Corruption While Parsing In Multithread Program?

Aug 28, 2009

language: C
OS: linux

I wrote a multithread program(approx 1000 thread have to run) and each thread has to parse a file(for each thread there is one file, ex:thread1 has to parse file1 and thread2 has to parse file2 like this....). I wrote "parse" program as follows. It is working well, if i create 50 threads. but if i run more than 200 thraeds Im getting doublefree corruption as follows:

Code:

*** glibc detected *** ./simulator: double free or corruption (fasttop): 0xb70007b0 ***

And some time I am getting parsing problem and error af follows:

Code:

powersetting.6607:1: parser error : Start tag expected, '<' not found (where powersetting.6607 is file name, when i check this file it is started with '<').

parse program as follows:

Code:

void parse_first(char* filename, int portnum, struct Poweroff *Powerptr1)
{
struct Poweroff *Powerptr;
Powerptr = Powerptr1;

[code]....

View 1 Replies View Related

Debian Programming :: Memory Usage When Running Java Program

Jun 28, 2013

I have a java program that runs on Debian as a background processor. Yesterday the Java program stopped running. I looked at the memory usage, the system only had 5MB memory left, so my guess is that the java program ran out of memory to use.

However, after we restarted the java program, we could see that the free memory count started to go up. It kept going up from 5MB to over 400MB. The increase of memory happened slowly, when I measured it, I could see that with each minute passing by, there were a bit more memory added into the free memory pool, and meanwhile, the java background process was running.

I wonder why this would ever happen. It's as if our java program first brought the machine done because it consumed all the memories, then after restart, it starts to give back memories.

View 2 Replies View Related

Programming :: Quick Measurement Of Free System Memory From Within C Program

Jul 21, 2010

I need to monitor the amount of free physical memory on Linux from within a large C program. The sampling will occur very frequently, so the measurement cannot be performance intensive. The fact that Linux uses much of the theoretically free memory for cache and buffers means that just measuring the free pages is not sufficient. Using free + cache + buffers gives an overestimate as not all cache/buffers can be freed, but I could get a rough idea of how much generally can't and subtract that from the answer.

Possible options that I've come across so far are: Parsing /proc/meminfo - but that involves reading from file which is slow. Extracting the free, cache and buffers values from the output of the Free command - but is there a quick way to do this? Parsing the /proc/freemem file produced by the API here - but this is again reading from file. Is there a way to get that output directly? Speed is an extremely high priority, and the answer it must accurately represent the amount of memory that my program could expand into (to within a few Mb).

View 1 Replies View Related

Programming :: Vuse The Capacity Feature To Allocate All Memory At Beginning Of Program?

Jan 7, 2010

I have a vector that I do not want to call new on during operation so I use the Capacity Feature to allocate all memory at beginning of program

Code:
struct chartype
{
public:
unsigned char value[MAXCHARTYPE_SIZE];
};

[Code].....

View 2 Replies View Related

Programming :: Find Physical Address Of Memory Provided By Kmalloc

Oct 22, 2009

I allocated a chunk of memory using kmalloc in a Device Driver. Kmalloc provides a pointer to the allocated memory. This is one of my first few drivers.

I assume that the address returned is a Virtual address. I need to find the physical address of the memory location. I am working on an Intel 64 bit Fedora machine. I used the virt_to_phys() routine present in <asm/io_64.h>. I found that this routine returns an unsigned long value (32 bit) instead of an unsigned long long value (64 bit). Moreover, it seems that it simply returns the address - OFFSET instead of extracting the value in the page tables.

So is there any function / system call in Linux which will allow me to see the actual physical address on the Intel 64 arch.

View 3 Replies View Related

Programming :: Find Out - How To Detach And Delete Shared Memory Segment When Hit Crtl-C

Mar 4, 2011

I have a program that creates and uses a shared memory segment. I am trying to find out how to detach and delete this shared memory segment when I hit crtl-C, and I still need the process to terminate.shmdt() and shmctl() have variables that are local to the main passed to them(shared and shmid)

Code:
//Prototype
void leave(int sig);
//part of code trying to use signal handling
if(signal(SIGINT, leave))

[Code]...

View 3 Replies View Related

Programming :: Can't Find Command, But Program Is Installed?

May 14, 2010

WindowsDude is back on the dark side of the web, the linux world, and he has encountered yet another impassable problem !There's a compiler mpicc, probably installed on the network at some location let's say /network/bin So when I write mpicc main.c I get the "can't find command" (or similar) error. Somehow it's supposed to work anyway. I think I need one of those magic commands to make it work. But the question is; which word will make it all happen? (I thought the DOS days were over!) I guess I could use the full path (provided that that binary really is in that folder), I want to bind that executable at that location to the much shorter mpicc.

View 3 Replies View Related

Programming :: Places On Internet To Find Projects For Learning To Program In C?

May 26, 2010

Essentially, I am reading the book "Absolute Beginner's Guide to C (Second Edition)", but the biggest problem is that it doesn't have problems nor projects to practice programming. Unfortunately, I do not have the greatest of an imagination to create my own ideas for problems to solve. Does anyone know of any sites that have good problems/projects to work on when I learn throughout the book?

View 6 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 :: 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 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

OpenSUSE :: How Does Apparmor Block A Bad-program

Jun 10, 2010

depending on reading some apparmor docs, I know that apparmor read logs to determine what profile a program will be, that means a profile only can be built when the program have been exec at least a time, or we already how will be executed of a specific program. but if a hack inserts a bad-program such as a back door or virus what should never be executed any time, and at the same time we don't know what's the consequence will happen due to the behaviors of a bad-program. therefore, how could apparmor do to prevent these situations? Can apparmor confine every thing what under a specific directory by default? because use: aa-autodep /path/to/restrict/* is 'complain' by default and everything are allowed, can apparmor deny everything by default?

View 2 Replies View Related

Networking :: Block IM Program Like Yahoo, Skype?

Oct 14, 2010

I want to block yahoo, skype IM program with a schedule.Just unblock from 10AM - 2PM and 3PM - 5PM everyday.I tried block from router, but it's not block completely and haven't schedule function.I found that a firewall (Iptables and ISA) can do that. Have anything else can? Can anyone give me some advises

View 3 Replies View Related

Ubuntu :: Inbuilt Logging System - Ran And Installation - Program Opened Automatically - Can't Find Program Executable

Feb 23, 2011

I was wondering whether there is an inbuilt logging system in UNIX?

I ran and installation and the program opened up automatically but I can't find the program executable.

If I could find a log then I could locate this file.

View 9 Replies View Related

OpenSUSE :: Can Apparmor Block Execute Any Program In A Specific Dir

Jun 10, 2010

prohibit execution of any program include shell command, only be profiled program could be executed, can apparmor do that?

View 5 Replies View Related

Ubuntu :: Peer Block Type Program For System?

Aug 12, 2010

Is there a program like peer block for ubuntu? It is an ip filter program. Here is the website to help answer questions on what type of program it is. http://www.peerblock.com/

View 6 Replies View Related

Ubuntu Security :: Block Outgoing Connection From A Program?

Jun 3, 2011

I open this thread after an unsuccessful long search over the Web. Essentially what I want is to block the outgoing connection of a program. All I know about this program is its name and so I don't have any information regarding the ports it utilizes or the address it may contact.

View 9 Replies View Related

Ubuntu :: How To Allocate Memory To Program?

Nov 24, 2010

I am running BWA (burrow-wheeler alignment) and, keep getting an error that there isn't enough memory allocated. How do I change the memory allocation? I'm working on a good quality desktop only a little over a year old, so having the memory shouldn't be the problem.

View 9 Replies View Related

Ubuntu Networking :: Program \ Use To Monitor The Number Of Computers That Are Connected To Network And Block Them?

Feb 1, 2011

i have recently had a house mate move in and he is using my wireless network, even though i asked him not to give out the network key to his friends either he has or they have hacked my network and are using it when they come over, is there a program i can use to monitor the number of computers that are connected to my network and block them, or is there a way i can just wee what is going on. They seem to just connect and i don't want to have to change the password particularly because that involves changing it on multiple devices.

View 1 Replies View Related

Ubuntu :: Record Memory Usage Of Program?

Jan 17, 2010

Is there a way I can start a program and then record a log of how much memory it's using at a specific interval until the program ends?

I've tried writing a shell script but get the error: ./apps/mem-test.sh: line 4: [: too many arguments

Here's the non-working script:

Code:
$HOME/apps/ImageMagick/bin/convert -limit memory 64 -limit map 128 $HOME/SSI/davidkennardphotography/Img-Orig/95-Pole-Bank.jpg -set option:filter:filter Lanczos -set option:filter:blur 0.8 -resize 1024x720 $HOME/resizedImage.jpg &
GOODY="ps -p $! -o pid,%cpu,rss,cmd | grep convert >>test.txt"

[Code]....

View 3 Replies View Related







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