![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with memory leak | kshk123 | HP-UX | 2 | 05-25-2009 08:01 AM |
| memory leak? | lenna | IP Networking | 2 | 05-25-2009 07:35 AM |
| Memory leak in pthread | mindTeaser | UNIX for Advanced & Expert Users | 4 | 05-18-2009 02:30 AM |
| Memory leak of fork() | whererush | High Level Programming | 7 | 05-11-2006 12:51 PM |
| about virtual memory and memory leak | shriashishpatil | High Level Programming | 4 | 02-20-2006 11:31 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Use Smart Pointers
Hello sonali
If this is a new development and if you are going to use multi-thread processes (pthread), and if they will live very long time, and if you are going to develop in C++. Then I recommend you to use smart pointers and exceptions ( for error handling ) . You could read about smart pointers at Boost C++ Libraries and also you can create such by yourselves. Pure C++ without any C influence. I've used such technique and the result is very nice. Programming is close to JAVA style. All resources allocated at constructor, deallocation at destructor. Check also what's written about C++ exception at the C++ standard. There is other ways too. For example you can spawn new processes for each new "task", allocate and do not free anything, When the task is completed terminate the process, and OS will free everything. Nevertheless which approach you gonna use to deal with "Memory/Resource Leaks" Use valgrind to check what's up. Best Regards O. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|