Sponsored Content
Full Discussion: leak memory when thread exit
Top Forums Programming leak memory when thread exit Post 302283525 by otheus on Tuesday 3rd of February 2009 12:31:48 PM
Old 02-03-2009
I don't see any memory allocation/deallocation here. And since you're not using C++ specific constructs (except comments), try compiling with just C.
 

9 More Discussions You Might Find Interesting

1. Programming

about virtual memory and memory leak

Hi, First of all I appreciate this group very much for its informative discussions and posts. Here is my question. I have one process whose virtual memory size increases linearly from 6MB to 12MB in 20 minutes. Does that mean my process has memory leaks? In what cases does the... (4 Replies)
Discussion started by: shriashishpatil
4 Replies

2. Programming

POSIX Thread - Memory leak

Hi all! I am implementing an http server in c++ using the posix thread, but i am having a memory leak and i cannot find the reason. I have already commented out the section that initializes the threads and i found out, the problem is when i initialize/run the threads. In the threads i have... (1 Reply)
Discussion started by: laurovalente
1 Replies

3. UNIX for Advanced & Expert Users

Check memory leak

I am running c++ code on AIX unix.I have a doubt that my code is using some memory but it is not clearing that.Some time i am getting heap allocation problem.In my code i am not using any malloc,new functions also i am justing using pointers and arrays. Is there any way i can find out if the... (2 Replies)
Discussion started by: ukatru
2 Replies

4. UNIX for Advanced & Expert Users

Need to create a memory leak

Hi. This might be a strange request, but does anyone have any idea on a simple shell script that would use more and more memory as it ran? Like a purposeful leak. I want to test the behaviour of an already running program when the machine runs out of memory. Thanks! (4 Replies)
Discussion started by: rebelbuttmunch
4 Replies

5. IP Networking

memory leak?

Hi All, my client server application can work in two modes: 1) one direction - only client sends msgs to server 2) two directions - server gives 'answers' to client. when program run in the first mode it looks OK, but when server answers to client than client's application exit its... (2 Replies)
Discussion started by: lenna
2 Replies

6. Programming

memory leak problem

hi all Can any one plz explain me about memory leak problem Thankx (5 Replies)
Discussion started by: sonali
5 Replies

7. Programming

Memory Leak

Hi, I am trying a database server which keeps a B+ plus tree structure and works on it. I am trying to find the memory used/leak while executing this process. I check the memory leak by using ps uax command. When i execute a delete query i am sure that my code frees up the existing... (9 Replies)
Discussion started by: kumaran_5555
9 Replies

8. Red Hat

Memory leak

Hi all I am using RED HAT 5.4, and i am getting memory uses problem. when i use "sync;echo 3 > /proc/sys/vm/drop_cache" command the memory will release after 2,3 hour memory show 95%. pls suggest right way. thanks (37 Replies)
Discussion started by: reply.ravi
37 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
thr_exit(3C)						   Standard C Library Functions 					      thr_exit(3C)

NAME
thr_exit - terminate the calling thread SYNOPSIS
cc -mt [ flag... ] file...[ library... ] #include <thread.h> void thr_exit(void *status); DESCRIPTION
The thr_exit() function terminates the calling thread, in a similar way that exit(3C) terminates the calling process. If the calling thread is not detached, then the thread's ID and the exit status specified by status are retained. The value status is then made available to any successful join with the terminating thread (see thr_join(3C)); otherwise, status is disregarded allowing the thread's ID to be reclaimed immediately. Any cancellation cleanup handlers that have been pushed and not yet popped are popped in the reverse order that they were pushed and then executed. After all cancellation cleanup handlers have been executed, if the thread has any thread-specific data, appropriate destructor functions will be called in an unspecified order. Thread termination does not release any application visible process resources,including, but not limited to, mutexes and file descriptors, nor does it perform any process level cleanup actions, including, but not limited to, calling any atexit() routines that might exist. If any thread, including the main() thread, calls thr_exit(), only that thread will exit. If main() returns or exits (either implicitly or explicitly), or any thread explicitly calls exit(), the entire process will exit. The behavior of thr_exit() is undefined if called from a cancellation cleanup handler or destructor function that was invoked as a result of either an implicit or explicit call to thr_exit(). After a thread has terminated, the result of access to local (auto) variables of the thread is undefined. Thus, references to local vari- ables of the exiting thread should not be used for the thr_exit() status parameter value. If any thread (except the main() thread) implicitly or explicitly returns, the result is the same as if the thread called thr_exit() and it will return the value of status as the exit code. The process will terminate with an exit status of 0 after the last non-daemon thread has terminated (including the main() thread). This behavior is the same as if the application had called exit() with a 0 argument at thread termination time. RETURN VALUES
The thr_exit() function cannot return to its caller. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
exit(3C), thr_create(3C), thr_join(3C), thr_keycreate(3C), attributes(5), standards(5) NOTES
Although only POSIX implements cancellation, cancellation can be used with Solaris threads, due to their interoperability. The status argument should not reference any variables local to the calling thread. SunOS 5.10 27 Mar 2000 thr_exit(3C)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy