- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Which command can be used to check a executabl...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2006 01:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2006 01:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2006 01:36 PM
06-05-2006 01:36 PM
Re: Which command can be used to check a executable file's static memory size?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2006 03:08 PM
06-05-2006 03:08 PM
Re: Which command can be used to check a executable file's static memory size?
If you read size(1), you'll see it's in decimal bytes, unless you use -x for hex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2006 01:39 AM
06-11-2006 01:39 AM
Re: Which command can be used to check a executable file's static memory size?
> cat testmem.c
#include
void main()
{
float b[67106210];
b[1]=20.0;
printf("%f\n", b[1]);
}
The array size is about 67106210*4=268,424,840Bytest.
After compiled (cc testmem.c -o testmem.out'), I got testmem.out.
> size testmem.out
text data bss dec hex filename
7662 128 84 7874 1ec2 testmem.out
> size -x testmem.out
text data bss dec hex filename
0x1dee 0x80 0x54 7874 1ec2 testmem.out
How to find 268,424,840 in the output of size?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2006 10:49 AM
06-12-2006 10:49 AM
Re: Which command can be used to check a executable file's static memory size?
You can't. That isn't a "static" size since auto variables are allocated on the stack. If you move it to file scope, you'll see it.
>void main()
This is illegal, it must be "int main()".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2006 12:37 PM
06-12-2006 12:37 PM
Re: Which command can be used to check a executable file's static memory size?
#include
float b[67108863];
int main()
{
b[1]=20.0;
printf("%f\n", b[1]);
return 1;
}
then I got the output of size:
> size testmem.out
text data bss dec hex filename
7650 128 268435556 268443334 10001ec6 testmem.out
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2006 01:56 PM
06-12-2006 01:56 PM
Re: Which command can be used to check a executable file's static memory size?
To return success, you return 0.
If you really want to know the frame sizes, you could look at:
/usr/ccs/bin/odump -unwind a.out
(You take the hex size and multiply by 8.)
For ELF files:
/usr/ccs/bin/elfdump -U a.out
(For PA64, hex size * 8. For IPF, it doesn't appear to be listed and you would have to disassemble the code.)