Sponsored Content
Top Forums Programming Size of memory used by a program Post 302930706 by Don Cragun on Tuesday 6th of January 2015 01:58:09 PM
Old 01-06-2015
Quote:
Originally Posted by shamrock
Running the size command on your executable lists the sizes of the text/data/bss segments...the last 2 cols gives the size of the total data segment consumed by your executable...
Code:
size a.out  
8283 + 308 + 84 = 8675

Not quite. It shows the size of the static data segment loaded when the process starts; it doesn't show the size of data allocated while the process is running (as in the 3 calls to malloc() in the given code snippet).
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Program/ Memory Problems

I need some advise. I have an application server running several applications. When I try and start a particular application when the others are running I receive the following. This is appearing in the core file that is created. ... (1 Reply)
Discussion started by: dbrundrett
1 Replies

2. UNIX for Advanced & Expert Users

memory size under AIX

Hi, how to know size of physical memory under AIX ? Many thanks. PS : man -k memory man : 0703-310 Fichier man introuvable. uname -a AIX server1 1 5 005202DF4C00 (3 Replies)
Discussion started by: big123456
3 Replies

3. Programming

Measuring memory used by a program?

I have a Java program. I want to measure the total memory used by the program, especially the peak memory. Is there a way to do it? I have tried utilities like time (which returns 0) and top (which is not very useful) as the program does not run for long. Can anyone suggest a way to do this?... (5 Replies)
Discussion started by: spathical
5 Replies

4. Solaris

How to know the size of the program currently executing in memory

hey everybody, i am currently working on solaris 10 os on a m5000 server. my problem is when i want the exact size of a program in execution, i am unable to do it. earlier i thought the RSS field of prstat but because of its large size it cant be the size. pmap -x shows some output but it includes... (2 Replies)
Discussion started by: aryansheikh
2 Replies

5. UNIX for Advanced & Expert Users

Out of Memory error when free memory size is large

I was running a program and it stopped and showed "Out of Memory!". at that time, the RAM used by this process is around 4G and the free memory size of the machine is around 30G. Does anybody know what maybe the reason? this program is written with Perl. the OS of the machine is Solaris U8. And I... (1 Reply)
Discussion started by: lilili07
1 Replies

6. Solaris

Memory or CPU size

Is there a command or file I can look at that tells me how much real memory a machine has? A little background. In my shop we run a bunch of java programs, sometimes some of these jobs have config definitions that call for 2G. I would like to know how many I can run before I exhaust rescources. Any... (12 Replies)
Discussion started by: Harleyrci
12 Replies

7. AIX

Memory limit for C program

Greetings - I'm porting a C application to an AIX (6.1) system, and have bumped into the limits AIX imposes on memory allocation, namely the default limit of 256MB for a process. I'm aware of the compilation flag that allows an application to gain access to up to 8 memory segments (each 256MB,... (4 Replies)
Discussion started by: traviswheeler
4 Replies

8. Programming

Shared memory between two c program

i have to shared a variable between two different c programs with shared memory and i do these: int main() { int a=5,b=7; int buffer; int *point; int shmid; shmid=shmget(IPC_PRIVATE , sizeof(buffer),0666); point=(int *)shmat(shmid,NULL,0); point=a; ... (21 Replies)
Discussion started by: tafazzi87
21 Replies

9. Programming

Help regarding memory leak in this C program

I have written this code in C which reads a very large collection of text files and does some processing. The problem with this code is that there are memory leaks which I am not able to figure out as to where the problem is. When I run this code, and see the memory usage using top command, then I... (7 Replies)
Discussion started by: shoaibjameel123
7 Replies

10. UNIX for Dummies Questions & Answers

Getting file size from memory

i want to avoid writing to a file on the disk. i'd like to do this in memory. i have a situation where i'm running cat file.txt | head -l 2024 > /tmp/data.txt now, i check the size of the data.txt by doing a "du -sh /tmp/data.txt how can i get the size of "head -l 2024" WITHOUT having to... (2 Replies)
Discussion started by: SkySmart
2 Replies
reference_element(7rheolef)					    rheolef-6.1 				       reference_element(7rheolef)

NAME
reference_element - reference element SYNOPSYS
The reference_element class defines all supported types of geometrical elements in one, two and three dimensions. The set of supported ele- ments are designate by a letter p point (dimension 0) e edge (dimension 1) t triangle(dimension 2) q quadrangle(dimension 2) T tetrahedron(dimension 3) P prism(dimension 3) H hexaedron(dimension 3) IMPLEMENTATION
class reference_element { public: // typedefs: typedef std::vector<int>::size_type size_type; // defines variant_type { p, t, q ..., H, ...}; // in an automatically generated file : typedef size_type variant_type; static const variant_type p = 0, e = 1, t = 2, q = 3, T = 4, P = 5, H = 6, max_variant = 7; // allocators/deallocators: reference_element (variant_type x = max_variant) : _x(x) { assert_macro (x >= 0 && x <= max_variant, "invalid type " << x); } // accessors: variant_type variant() const { return _x; } char name() const { return _name[_x]; } size_type dimension() const { return _dimension[_x]; } friend Float measure (reference_element hat_K); size_type size() const { return _n_vertex[_x]; } size_type n_subgeo(size_type subgeo_dim) const { return n_subgeo (variant(), subgeo_dim); } size_type n_edge() const { return n_subgeo(1); } size_type n_face() const { return n_subgeo(2); } size_type subgeo_size (size_type subgeo_dim, size_type loc_isid) const { return subgeo_n_node (_x, 1, subgeo_dim, loc_isid); } size_type subgeo_local_vertex(size_type subgeo_dim, size_type loc_isid, size_type loc_jsidvert) const { return subgeo_local_node (_x, 1, subgeo_dim, loc_isid, loc_jsidvert); } void set_variant (variant_type x) { _x = x; } void set_variant (size_type n_vertex, size_type dim) { _x = variant (n_vertex, dim); } void set_name (char name); // helpers: static variant_type variant (char name); static variant_type variant (size_type n_vertex, size_type dim); static char name (variant_type variant) { return _name [variant]; } static size_type dimension (variant_type variant) { return _dimension[variant]; } static size_type n_vertex (variant_type variant) { return _n_vertex [variant]; } static size_type n_node (variant_type variant, size_type order); static size_type n_sub_edge (variant_type variant); static size_type n_sub_face (variant_type variant); static size_type n_subgeo (variant_type variant, size_type subgeo_dim); static size_type subgeo_n_node (variant_type variant, size_type order, size_type subgeo_dim, size_type loc_isid); static size_type subgeo_local_node (variant_type variant, size_type order, size_type subgeo_dim, size_type loc_isid, size_type loc_jsidnod); static variant_type first_variant_by_dimension (size_type dim) { return _first_variant_by_dimension[dim]; } static variant_type last_variant_by_dimension (size_type dim) { return _first_variant_by_dimension[dim+1]; } static size_type first_inod_by_variant (variant_type variant, size_type order, variant_type subgeo_variant); static size_type last_inod_by_variant (variant_type variant, size_type order, variant_type subgeo_variant) { return first_inod_by_variant (variant, order, subgeo_variant+1); } static size_type first_inod (variant_type variant, size_type order, size_type subgeo_dim) { return first_inod_by_variant (variant, order, first_variant_by_dimension(subgeo_dim)); } static size_type last_inod (variant_type variant, size_type order, size_type subgeo_dim) { return first_inod_by_variant (variant, order, last_variant_by_dimension(subgeo_dim)); } static void init_local_nnode_by_variant (size_type order, boost::array<size_type,reference_element::max_variant>& loc_nnod_by_variant); protected: // constants: static const char _name [max_variant]; static const size_type _dimension [max_variant]; static const size_type _n_vertex [max_variant]; static const variant_type _first_variant_by_dimension[5]; // data: variant_type _x; }; rheolef-6.1 rheolef-6.1 reference_element(7rheolef)
All times are GMT -4. The time now is 06:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy