Sponsored Content
Full Discussion: How to free the memory?
Top Forums Programming How to free the memory? Post 87949 by marvin on Saturday 29th of October 2005 01:36:34 PM
Old 10-29-2005
and don't forget to test the return value of the malloc function.

Code:
void	*my_malloc(unsigned int size)
{
  void	*p;

  p = malloc(size);
  if (p == 0)
    {
      fprintf(stderr, "Error with the malloc function\n");
      exit(1);
    }
  return (p);
}

 

10 More Discussions You Might Find Interesting

1. AIX

Free Memory

Hi, how to find free memory in aix? for installing oracle,I have used svmon but not getting proper output (1 Reply)
Discussion started by: manoj.solaris
1 Replies

2. AIX

Free Memory in aix

Hi, I want to know how to find out free physical memory in aix, (11 Replies)
Discussion started by: manoj.solaris
11 Replies

3. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

4. Solaris

how to get the more memory free space (see memory free column)

Hi all, Could please let me know how to get the more memory free space (not added the RAM) in local zone. -bash-3.00# vmstat 2 5 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr s0 s1 s1 s1 in sy cs us sy... (3 Replies)
Discussion started by: murthy76
3 Replies

5. Red Hat

how to find out free memory?

hi, I have done the below, but am confused as to how much memory is "free" please help thanks $ free total used free shared buffers cached Mem: 132033488 48827536 83205952 0 1007696 45404632 -/+ buffers/cache: 2415208 ... (7 Replies)
Discussion started by: JamesByars
7 Replies

6. 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

7. Programming

Memory free() in C

Hi guys. I've a question, if we are using a syscall that receives a string allocated dynamicaly to a determined size, or NUL and it will allocate the apropriate size. We should free the memory or the OS will do it for us? If a function returns a pointer we should free that poiter when we are done... (7 Replies)
Discussion started by: pharaoh
7 Replies

8. AIX

How to find AIX Free Memory?

All, AIX: 6.1 64 bits How to find out Free memory available on AIX 6.1 64 bits When I used : svmon -G size inuse free pin virtual mmode memory 1048576 612109 191151 215969 549824 Ded-E pg space 4325376 ... (1 Reply)
Discussion started by: a1_win
1 Replies

9. Solaris

Is there a way to free up memory manually ?

Hi, I am wondering if there is a way to free up memory in Solaris manually ? the way we can do it in Linux for example : echo `/bin/date` "************* Memory Info Before *************" free -m sync echo 1 > /proc/sys/vm/drop_caches echo 2 > /proc/sys/vm/drop_caches echo 3 >... (13 Replies)
Discussion started by: terrykhatri531
13 Replies

10. Solaris

How the free memory threshold?

If I understand your question correctly, you are asking for an explanation of Solaris memory manager. You'd better ask Oracle that question because you are talking about Solaris kernel internals. The operating system kernel has no reason to kick a process's memory set out of real memory until... (4 Replies)
Discussion started by: hicksd8
4 Replies
Text::vCard::Node(3pm)					User Contributed Perl Documentation				    Text::vCard::Node(3pm)

NAME
Text::vCard::Node - Object for each node (line) of a vCard SYNOPSIS
use Text::vCard::Node; my %data = ( 'param' => { 'HOME,PREF' => 'undef', }, 'value' => ';;First work address - street;Work city;London;Work PostCode;CountryName', ); my $node = Text::vCard::Node->new({ node_type => 'address', # Auto upper cased fields => ['po_box','extended','street','city','region','post_code','country'], data => \%data, }); DESCRIPTION
Package used by Text::vCard so that each element: ADR, N, TEL etc are objects. You should not need to use this module directly, Text::vCard does it all for you. METHODS
new() my $node = Text::vCard::Node->new({ node_type => 'address', # Auto upper cased fields => ['po_box','extended','street','city','region','post_code','country'], data => \%data, }); value() # Get the value for a standard single value node my $value = $node->value(); # Or set the value $node->value('New value'); other()'s # The fields supplied in the conf area also methods. my $po_box = $node->po_box(); # if the node was an ADR. # Set the value. my $street = $node->street('73 Sesame Street'); unit() my @units = @{$org_node->unit()}; $org_node->unit(['Division','Department','Sub-department']); As ORG allows unlimited numbers of 'units' as well as and organisation 'name', this method is a specific case for accessing those values, they are always returned as an array reference, and should always be set as an array reference. types() my @types = $node->types(); or my $types = $node->types(); This method will return an array or an array ref depending on the calling context of types associated with the $node, undef is returned if there are no types. All types returned are lower case. is_type() if($node->is_type($type) { # ... } Given a type (see types() for a list of those set) this method returns 1 if the $node is of that type or undef if it is not. is_pref(); if($node->is_pref()) { print "Prefered node" } This method is the same as is_type (which can take a value of 'pref') but it specific to if it is the prefered node. This method is used to sort when returning lists of nodes. add_types() $address->add_types('home'); my @types = qw(home work); $address->add_types(@types); Add a type to an address, it can take a scalar or an array ref. remove_types() $address->remove_types('home'); my @types = qw(home work); $address->remove_types(@types); This method removes a type from an address, it can take a scalar or an array ref. undef is returned when in scalar context and the type does not match, or when in array ref context and none of the types match, true is returned otherwise. group() my $group = $node->group(); If called without any arguments, this method returns the group name if a node belongs to a group. Otherwise undef is returned. If an argument is supplied then this is set as the group name. All group names are always lowercased. For example, Apple Address book used 'itemN' to group it's custom X-AB... nodes with a TEL or ADR node. export_data() my $value = $node->export_data(); This method returns the value string of a node. It is only needs to be called when exporting the information back out to ensure that it has not been altered. NOTES If a node has a param of 'quoted-printable' then the value is escaped (basically converting Hex return into as far as I can see). EXPORT None by default. AUTHOR
Leo Lapworth, LLAP@cuckoo.org SEE ALSO
Text::vCard Text::vCard::Addressbook perl v5.10.1 2010-08-19 Text::vCard::Node(3pm)
All times are GMT -4. The time now is 07:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy