Sponsored Content
Full Discussion: How to handle memory error?
Top Forums Programming How to handle memory error? Post 69775 by diganta on Wednesday 20th of April 2005 05:17:04 AM
Old 04-20-2005
Question How to handle memory error?

Hi,

I need to know what is the right way of handling out of memory conditions. If a program is not able to dynamically allocate memory (new fails), is it right to wait for some amount of time (say 5 sec) and then try again to allocate memory? Or should we kill the process and again restart it? My process needs to be running continuously. Even if due to some error it has to stop, it should resume action after some time automatically without any manual intervention.

Thanks,
Diganta
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP - To handle error while transferring files

Hi, I had written an FTP script where in I loop through the directories and transfer the files from each and every directory of Windows to UNIX. Now the problem is when 1. The connection is unable to be established I should return some error codes 2. When there is some system... (1 Reply)
Discussion started by: mahalakshmi
1 Replies

2. Solaris

Error Message: find: cannot open /: Stale NFS file handle

I am using the "find" command below and it respond with the error message " find: cannot open /: Stale NFS file handle" what does it mean? what can I do about it? Need advice, thanks. below are the command that I enter, the respond and the error message: root@ScripServer:/# find / -name... (1 Reply)
Discussion started by: ezsurf
1 Replies

3. Solaris

NFS write error on host : Stale NFS file handle

:confused:Hi all When i see in the /var/adm/messages, i saw the following error unix: NFS write error on host : Stale NFS file handle. unix: (file handle: 45ca415 3e7 a0000 2c7f6 3ebfc25f a0000 2 3e49) It is using sunOS 5.7. Is anybody know what is this error? Is is related to any network... (2 Replies)
Discussion started by: AirWalker83
2 Replies

4. Solaris

memory error

Hi All, I recently patched one of t5120s I have (running solaris 10). I rebooted my system after patching and found following meesage on console, While showfaults in ALOM shows following message: showfaults Last POST Run: Sat Feb 14 05:51:08 2009 How serious is this error and can... (3 Replies)
Discussion started by: upengan78
3 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. Shell Programming and Scripting

Error PHP Fatal error: Allowed memory size of 67108864 bytes exhausted(tried to allocate 401 bytes)

While running script I am getting an error like Few lines in data are not being processed. After googling it I came to know that adding such line would give some memory to it ini_set("memory_limit","64M"); my input file size is 1 GB. Is that memory limit is based on RAM we have on... (1 Reply)
Discussion started by: elamurugu
1 Replies

7. UNIX for Dummies Questions & Answers

Difference between handle to the thread HANDLE and thread identifier pthread_t

This question might be silly but its confusing me a bit: What is the difference between handle to the thread HANDLE and thread identifier pthread_t? ---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ---------- Sorry I saw details and HANDLE is in windows and... (0 Replies)
Discussion started by: rupeshkp728
0 Replies

8. Shell Programming and Scripting

Handle error

I have a script as below , the script can tar file to the tape , however , it is fail to handle the error , if there is error like the backup file is in writing , then it will echo this is fail ( but the file has successful backup actually , so the backup task is succes , but it still report it is... (6 Replies)
Discussion started by: ust
6 Replies

9. Linux

How does the Operating System handle memory?

Hey everyone. Ok, so I know that from inside of any particular program, it see's through virtualized memory, a full range of available memory. It is given the ability then to place variables, data, user input etc, on the Stack, Heap, BSS, or Code segment of it's range. My question is what does the... (5 Replies)
Discussion started by: Lost in Cyberia
5 Replies

10. Solaris

NFS write error on host xyz: Stale NFS file handle - Solaris 10

Oct 13 12:19:15 xyz nfs: NFS write error on host xyz: Stale NFS file handle. Oct 13 12:19:15 xyz nfs: (file handle: 68000000 1bc5492e 20000000 377c5e 1ce9395c 720a6203 40000000 bdfb0400) Oct 13 12:19:15 xyz nfs: NFS write error on host zyz: Stale NFS file handle. Oct 13 12:19:15 xyz nfs: ... (5 Replies)
Discussion started by: psychocandy
5 Replies
BOSCONFIG(5)							AFS File Reference						      BOSCONFIG(5)

NAME
BosConfig - Defines server processes for the BOS Server to monitor DESCRIPTION
The BosConfig file lists the processes that the Basic OverSeer (BOS) Server monitors on its server machine, and thus defines which AFS server processes run on the machine. It specifies how the BOS Server reacts when a process fails, and also defines the times at which the BOS Server automatically restarts processes as part of performance maintenance. The file must reside in the /var/lib/openafs/local directory on each AFS server machine. A server process entry in the BosConfig file records the following information: o The entry type, which is one of the following: cron Designates a server process that runs periodically instead of continuously. The BOS Server starts a cron process only at specified times, not whenever it fails. All standard AFS process entries except "fs" are simple (there are no standard cron processes). fs Designates a group of interdependent server processes. If one of the processes fails, the BOS Server must coordinate its restart with the restart of the other processes in the group, possibly by stopping them first. There is only one standard entry of this type, for which the conventional name is "fs". It combines three server processes: the File Server (fileserver process), the Volume Server (volserver process), and the Salvager (salvager process). These processes all operate on the same data--the AFS data stored on an AFS server machine's /vicep partitions and mounted in the AFS filespace--but in different ways. Grouping the processes prevents them from attempting to access the same data simultaneously, which can cause corruption. During normal operation, the Salvager process is not active. If the File Server process fails, however, the BOS Server stops the Volume Server process and runs the Salvager process to correct any corruption that resulted from the failure. (The administrator can also issue the bos salvage command to invoke the Salvager process.) If the Volume Server fails, the BOS Server can restart it without stopping the File Server or running the Salvager. simple Designates a server process that runs independently of any other on the server machine. If a simple process fails, the BOS Server does not have to coordinate its restart with any other process. o The entry name. The conventional name for an entry in the BosConfig file and the associated process matches the binary filename. When issuing any bos command that takes the -instance argument, identify each process by the name used in the BosConfig file. For a list of the names, see the bos create reference page. o The process's status flag, which determines whether the BOS Server attempts to start the process in two cases: each time the BOS Server itself restarts, and when the process fails. The BosConfig file currently uses a binary notation to indicate whether the BOS Server attempts to restart the process as necessary or does not monitor it at all. For the sake of clarity, the AFS documentation refers to the flags as "Run" and "NotRun" instead. Only a system administrator, not the BOS Server, can change the flag. o One or more command parameters which the BOS Server invokes to start the process or processes associated with the entry: o A "cron" entry has two command parameters, the first the complete pathname to the program, and the second the time at which the BOS Server invokes the program. o The "fs" entry has three command parameters, each the complete pathname to the fileserver, volserver, and salvager programs, in that order. o A "simple" entry has only one command parameter, the complete pathname to the program. In addition to server process entries, the BosConfig file specifies the times at which the BOS Server performs two types of automatic process restarts: o The general restart time at which the BOS Server restarts itself and then each process for which the entry in the BosConfig file has status flag "Run". The default setting is Sunday at 4:00 a.m. o The binary restart time at which the BOS Server restarts any server process for which the time stamp on the binary file in the /usr/lib/openafs directory is later than the last restart time for the process. The default is 5:00 a.m. Although the BosConfig file is in ASCII format, it is normally best not to use a text editor to alter it. The parser is very picky, and incorrectly formatted entries can prevent server startup in ways that are difficult to diagnose. Instead, use the appropriate commands from the bos command suite: o The bos create command to create an entry in the file and start the associated process. o The bos delete command to remove an entry from the file after the bos stop command is used to stop the associated process. o The bos getrestart command to display the times at which the BOS Server performs automatic restarts. o The bos setrestart command to set the times at which the BOS Server performs automatic process restarts. o The bos start command to change an entry's status flag to "Run" and start the associated process. o The bos status command to display all processes listed in the file. o The bos stop command to change an entry's status flag to "NotRun" and stop the associated process. There are also bos commands that start and stop processes without changing entries in the BosConfig file. The BOS Server reads the BosConfig file only when it starts, transferring the information into its memory. Thus a process's status as represented in the BOS Server's memory can diverge from its status in the BosConfig file. The following commands change a process's status in the BOS Server's memory only: o The bos restart command restarts a specified set of processes, all processes, or all processes other than the BOS Server. o The bos shutdown command stops a process. o The bos startup command starts a process. When the BOS Server shuts down, it rewrites BosConfig, discarding any changes made manually to that file. To change the configuration for the next BOS Server restart, instead write a new file to BosConfig.new. If BosConfig.new exists when the BOS Server starts, it will rename that file to BosConfig before reading its configuration. SEE ALSO
bos_create(8), bos_delete(8), bos_getrestart(8), bos_restart(8), bos_setrestart(8), bos_shutdown(8), bos_start(8), bos_startup(8), bos_status(8), bos_stop(8), bos_salvage(8), fileserver(8), salvager(8), volserver(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BOSCONFIG(5)
All times are GMT -4. The time now is 03:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy