Visit Our UNIX and Linux User Community


free() function?????


 
Thread Tools Search this Thread
Top Forums Programming free() function?????
# 1  
Old 04-29-2002
Question free() function?????

Did any one knows everything about the unix memory management system and the free() function?
There is no problem when making the dynamic arrays free. The problem is that when trying free the link lists. The free() function does not work when trying to make free the link lists. I would be greatfull if any one can help me about the memory management.
# 2  
Old 04-29-2002
Please be more specific. What in particular does not work? Are you getting an error message during compile? run-time? Does the program crash or produce unexpected results?
# 3  
Old 04-29-2002
Think that I have a dynamic array of a struct. This struct includes link lists. I just want to clean the memory I have used for that link lists and dynamic array. I used free it gives no error in compile time neither in run time. But the memory usage of the program increases all the time and when it comes to a point that is too high program gives Segmentation Fault!(What a suprise).
# 4  
Old 05-07-2002
You need to start at the end of the link list and free() each element and then move up in the list until you reach the head. Then all the elements of the link list should be free() and your memory leak should be gone.
# 5  
Old 05-10-2002
Is your application threaded??

Previous Thread | Next Thread
Test Your Knowledge in Computers #141
Difficulty: Easy
The original Unix operating system was not written in assembly language.
True or False?

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Function - Make your function return an exit status

Hi All, Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition. #Body function1() { if then echo "exist" else echo "not exist" } #if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies

2. Shell Programming and Scripting

Will files, creaetd in one function of the same script will be recognized in another function?

Dear All. I have a script, which process files one by one. In the script I have two functions. one sftp files to different server the other from existing file create file with different name. My question is: Will sftp function recognize files names , which are created in another... (1 Reply)
Discussion started by: digioleg54
1 Replies

3. Programming

How to step in one function after the function be executed in gdb?

In gdb, I can call one function with command "call", but how can I step in the function? I don't want to restart the program, but the function had been executed, gdb will execute next statement, and I don't know how to recall the function. (4 Replies)
Discussion started by: 915086731
4 Replies

4. Solaris

MountPoint / is 8% with 899.49MB free crossing threshold of 10% free

Hi, I have a problem one of the server file system cross the limitation MountPoint / is 8% with 899.49MB free crossing threshold of 10% free out put please help how to resolve this dev/vx/dsk/bootdg/rootvol 9.8G 8.8G 956M 91% / /devices ... (3 Replies)
Discussion started by: sriniva0
3 Replies

5. Shell Programming and Scripting

SHELL SCRIPT Function Calling Another Function Please Help...

This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord but only one record is getting wrote in DB.... Please advise ASAP...:confused: function InsertFtg { FTGSTR="" echo "Saurabh is GREAT $#" let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies

6. Shell Programming and Scripting

Return a value from called function to the calling function

I have two scripts. script1.sh looks -------------------------------- #!/bin/bash display() { echo "Welcome to Unix" } display ----------------------------- Script2.sh #!/bin/bash sh script1.sh //simply calling script1.sh ------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies

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

8. Shell Programming and Scripting

Passing global variable to a function which is called by another function

Hi , I have three funcions f1, f2 and f3 . f1 calls f2 and f2 calls f3 . I have a global variable "period" which i want to pass to f3 . Can i pass the variable directly in the definition of f3 ? Pls help . sars (4 Replies)
Discussion started by: sars
4 Replies

Featured Tech Videos