Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Operating System (OS) Interviews:BSDBulnexCompiler Linker LoaderDisk Operating System (DOS)MAC Operating SystemNative iOS EngineerOperating System (OS)OS Data StructuresOS General ConceptsOS Memory ManagementOS MultithreadingOS Process ManagementOS X Mountain LionRTOSShell ScriptingSolarisSolaris AdminSolaris CommandsSymbianUnix CommandsUNIX Operating SystemUnix Socket ProgrammingUnix/Linux programmingVxWorksWindowsWindows 7Windows AdministratorWindows CEWindows Programming
Copyright © 2018. All Rights Reserved
Unix/Linux programming Interview Question:
Give examples of how memory leaks can occur with c programs?
Submitted by: AdministratorMemory leaks can be occured if no allocated memory is freed. for example,malloc() and free().It is always a good practice to release the memory because it can be dangerous. it could afftect the whole program and lead to very difficult situtation. Make sure that you are releasing the allocated memory at time. so next time you write program, think twice before allocating memory. I always writedown a notes before i start program. so i know whats going on.
Momery leak example occurs when a developer allocates memory, assigns it to a pointer, and then assigns a different value to the pointer without freeing the first block of memory. In this example, overwriting the address in the pointer erases the reference to the original block of memory, making it impossible to release.
Submitted by: Administrator
Momery leak example occurs when a developer allocates memory, assigns it to a pointer, and then assigns a different value to the pointer without freeing the first block of memory. In this example, overwriting the address in the pointer erases the reference to the original block of memory, making it impossible to release.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.