C_132 Introduction to Dynamic Memory Allocation in C | SMA vs DMA

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 257

  • @bhaskarchakraborty8328
    @bhaskarchakraborty8328 2 года назад +120

    Sma - complie time
    Dma - run time
    Dma - pointer required
    Sma - doest require any pointer
    Dma - memory can be freed
    Sma - wastage of memory

    • @sarthaksavarn8913
      @sarthaksavarn8913 9 месяцев назад +3

      Sma :- permanent memory allocation throughout the program
      Dma :- we can change the size of memory during the program

    • @ictfan-ly8gh
      @ictfan-ly8gh 5 месяцев назад

      Sma-- less efficient
      Dma-- more efficient
      Sma---program executes faster
      Dma--program executes less fast

    • @TanujGutta-r3k
      @TanujGutta-r3k Месяц назад

      ​@@sarthaksavarn8913but memory is free after the completion of the program in sma

    • @harshithchowdary5731
      @harshithchowdary5731 Месяц назад

      Sma allocate the memory at compile time
      Dma allocates the memory in run time
      In sma we cannot change the size of the memory once we allocated
      But in dma we can change size the size of the memory

  • @parisa9374
    @parisa9374 2 года назад +46

    I am very glad you are back Jenny! Please whenever it is convenient for you, make videos about storage classes (auto, register, static, external storage classes) and command-line arguments, explaining the nuts and bolts of them as you do always. Thank you very much and again happy to see you back🙏

    • @parisa9374
      @parisa9374 2 года назад +8

      More requests dear Jenny;) May you please make some videos on how you generally study and learn new concepts from CS and IT that you are this much comfortable and knowledgeable ( I know it is practice and experience but I would like to know your approach toward learning new concepts in CS/IT? How do you study and read the CS textbooks? What else that you are recommending? Thank you very much and keep up the great work! Take care 🙏

    • @robogamer2023
      @robogamer2023 Год назад

      آره بنظرم خیلی مفید بود واقعاً منم که قبل از امتحان دارم میبینم ای وای خاک تو سرم 🤣

  • @divyprakashpandey4458
    @divyprakashpandey4458 Год назад +52

    Notes for this session:
    - In SMA, the compiler is pre-defined for how much memory is to be allocated to a certain variable & these memory allocated at run-time CANNOT be modified during runtime
    - In DMA ,The compiler allocates memory as per programmer needs and this memory can be changed during the runtime of code
    - DMA is one of the application of Pointers
    - Always remember to free the memory from the pointer once, you're done!
    - Memory is dynamically allocated from the Heap

  • @saibalam7852
    @saibalam7852 2 года назад +23

    I was just eagerly waiting for this concept since 25 days mam tq for coming back and teaching this 🥰

  • @c.ravikishorereddy8099
    @c.ravikishorereddy8099 2 года назад +7

    Maam you are the only one in my life who helps me to reach my goals

  • @asapnino3625
    @asapnino3625 Год назад +11

    Key Differences:
    Static memory allocation occurs at compile time and has a fixed size and lifetime, while dynamic memory allocation occurs at runtime, with variable size and potentially longer lifetimes.
    Static memory allocation is often used for simple, fixed-size data structures and is managed automatically by the compiler. Dynamic memory allocation is used when data sizes are not known in advance and requires manual management.
    Static allocation is typically faster and more deterministic, while dynamic allocation provides greater flexibility.
    Dynamic allocation can lead to memory leaks or other runtime issues if memory is not deallocated properly. Static allocation avoids such issues.
    The choice between static and dynamic memory allocation depends on the specific requirements of the program and the need for flexibility, performance, and memory management control.

  • @erwanfadlysudimanstudent1199
    @erwanfadlysudimanstudent1199 2 года назад +7

    This is new??! Jenny your videos have saved me from linked list assignment! Love it and thank you! I dont even have any assignment atm but come for your video.

  • @Maahi-n1
    @Maahi-n1 2 года назад +48

    Hi mam i am not watching this video because I am there in your's string video but I will see this video after file concept thank you mam you are great🖖

  • @Adiii9657
    @Adiii9657 2 года назад +16

    I always come to get knowledge ❌
    I always come here to see mam 😍✔️

  • @MuutasimMohamed
    @MuutasimMohamed День назад

    what an explanation of DMA!!!!!!! i have enjoyed alot

  • @damiangermaine7218
    @damiangermaine7218 2 года назад +2

    Best Lec Ever , I'll mention you in my Graduation ,😍Lol

  • @mvbangar
    @mvbangar 2 года назад +5

    Thank you mam your Teaching technique is very helpfull for knowledge or easily understandable and clearing proper concepts

  • @aparnamane4899
    @aparnamane4899 2 года назад +4

    SMA DMA
    1)At Compile time. 1) At run time.
    2)memory is allocated form stack frame 2)memory is allocated form Heap(pool of free
    ( stack memory segment). memory block).
    3)Fixed memory allocation (we cannot increase or 3)we can increase or decrease memory
    decrease memory size according to our pr. Req.) size according to our pr. Req.
    4)we take var, ptr also. 4)here we req. ptr to access mem. From heap.
    5)we free allocated mem. Afte exit the program.
    5)in DMA:= we can use malloc(),calloc(),free(),realloc() to free memory and all. & we free memory block and t reusability) to use in many time in program and any whrere. (mem. Is reusabale).

  • @abhaymehta8809
    @abhaymehta8809 2 года назад +5

    Much needed video. Thank you mam. I was waiting for video on this topic. ❤️

  • @EhabSmH0
    @EhabSmH0 Год назад +1

    SMA:
    1- You can not free the remaining memory, and the remaining will be a waste of memory.
    2- Memory allocated from the stack part.
    3- Pointers does not require.
    DMA:
    1- You can free the remaining memory. (allocate and deallocate)
    2- Memory allocated dynamically from the heap part.
    3- Pointers are a must.

  • @anneymainayashwanth6336
    @anneymainayashwanth6336 2 года назад

    Mam
    Every one are watching to learn ,
    But I watch to see you!!
    You are soo beautiful🥰

  • @Questers_s
    @Questers_s 2 года назад

    Mam you are legend. I am in deep love with your teaching.

  • @yasaswivaliveti6187
    @yasaswivaliveti6187 2 года назад

    Mam the way you teach the concept is awesome not only the content but the people who explain it should also be good you are adorable mam If you like my comment please do reply

  • @motemontero5592
    @motemontero5592 2 года назад +2

    Greater teacher appreciate u soon 1M subscribe will reach

  • @udaysankar9
    @udaysankar9 9 месяцев назад

    In my career...i listened only your classes with intrest 😅
    Thank you mam 💖

  • @tawseeffayaz6175
    @tawseeffayaz6175 2 года назад +3

    Mam ur lectures are really best for competitive exam...

  • @सनातनी-श5ध
    @सनातनी-श5ध 2 года назад +13

    Mam, could you prepare a video on memory layout? It with be really helpful to us to visualise and get this memory allocation concept crystal clear...

  • @arpityadav1437
    @arpityadav1437 2 года назад +1

    Ma'am one day in future I want to meet you , because you are helping ous too much,🥰🥰

  • @kashifaziz5272
    @kashifaziz5272 2 года назад +1

    You look so beautiful these days, and your teaching skills are awesome.

  • @dangerousdesert
    @dangerousdesert 2 года назад +1

    Most beneficial video,
    love you mam.

  • @cs_111_amansingh6
    @cs_111_amansingh6 2 года назад

    Mam u are my crush mai series nhi aapki vedio dekhta h thanku mam ❤️

  • @tharunranjith720
    @tharunranjith720 2 года назад +1

    Mam I love the way you teach ❤❤❤

  • @Muaz531
    @Muaz531 2 года назад

    Mam your way of teaching is so soo sooo sooooo nice....,

  • @sasikanthputtupu2384
    @sasikanthputtupu2384 2 года назад +4

    Mam please Do Java and python also because ,your explanation is very very Good😊

  • @MdRubel-hr5ur
    @MdRubel-hr5ur Год назад

    Mam this video is very very helpful. Thank you so much dear Mam.

  • @parisa9374
    @parisa9374 2 года назад +16

    May you please discuss and explain more about the memory layout at 12:06 as you suggested? Thank you very much!

  • @uttamkumerroy38
    @uttamkumerroy38 2 года назад +1

    i have learn lots of new thinks here.. thank you so much mam...

  • @saibalam7852
    @saibalam7852 2 года назад +5

    Mam after this C programming start with DAA because calculating time and space complexity is a big question in my mind that u can only clear this thing 😘

    • @ianazraf
      @ianazraf 2 года назад

      Yes mam.. Please continue dsa from asymptotic notations from where u stopped.. 😊

  • @eumm11
    @eumm11 Год назад +1

    thank you Professor Jenny, you are always very helpful!

  • @satyamantapurkar4531
    @satyamantapurkar4531 2 года назад +2

    Very well explained 👍

  • @subhabratabehera8835
    @subhabratabehera8835 2 года назад +1

    Looks gorgeous 😅🔥♥️

  • @kartiksheoran3603
    @kartiksheoran3603 8 месяцев назад +1

    Thanku mam for explaining very clearly

  • @Strawberry12352
    @Strawberry12352 2 года назад +4

    Ma'am, you said after the execution the memory will be freed like that same block can be used in another program. But during execution, the memory is allocated for that particular variable so that memory is not available only during that program. so my question is whatever code we write that things don't take any space in memory once execution is done? (as you said they are freed in sma also)

  • @ststechnology-s9r
    @ststechnology-s9r 9 месяцев назад

    Thanks for such helpful content.❤

  • @prasad.kkomarapuri712
    @prasad.kkomarapuri712 2 года назад +1

    Mam big fan of you please reply ..♥️♥️🔥🔥

  • @mdnadimbhuiyan4310
    @mdnadimbhuiyan4310 10 месяцев назад

    Deep concept🖤🔥

  • @asogwafidelia9239
    @asogwafidelia9239 2 года назад

    You are the best.❤

  • @anuragpatelhbtu2665
    @anuragpatelhbtu2665 2 года назад

    love you ma'am ❤❤❤

  • @ShangSiQi09
    @ShangSiQi09 2 года назад +120

    I'm lucky because I'm not a student so I can focus on her Cuteness 💖

  • @harshbachchani7981
    @harshbachchani7981 2 года назад

    thank you mam this is the best matter for me for learning c programming

  • @Sanai9
    @Sanai9 Год назад

    sma:-memory allocation at compile time i.e fixed memory
    memory stored in stack
    loss and wastage of memory
    cant be freed until end of the program
    dma:-memory aloocated at run time i.e variable memory we can change memory allocation according to our usage
    memory stored in heap
    no loss or wastage of memory
    can be freed anywhere btw the end of the program

  • @chandankorado3749
    @chandankorado3749 2 года назад +8

    Ma'am... Design and Analysis of Algorithm ( DAA ) ... Only 5 five videos are made....
    We want more topics.. could you please make those ma'am...

  • @GurukulStudyCentreIndia
    @GurukulStudyCentreIndia 2 года назад +1

    Beautiful teaching.

  • @muhammadahmadyousaf2824
    @muhammadahmadyousaf2824 2 года назад

    Yaayyyy. Mam is back 💖

  • @RukhaySukhayPakwaan
    @RukhaySukhayPakwaan 2 года назад

    I love you mam❤️.. love from nepal❤️❤️

  • @kavinrajR.R
    @kavinrajR.R 3 месяца назад

    sma -comlie time
    dma - run time
    dma - we use pointer
    sma- we did have reuseablity

  • @Mehedihasan-rahat
    @Mehedihasan-rahat Месяц назад

    Thanks ❤

  • @ishitakaur987
    @ishitakaur987 8 дней назад +1

    Static memory Allocation
    1.This allocates memory during compile time
    2. remains fixed through out the code's execution
    3.If whole memory is not used ,than it leads to its wastage
    4. memory gets allocated in the stack frames
    Dynamic Memory Allocation
    1.This allocates memory during the program's execution
    2.memory can be altered as per the needs of the user
    3.helps avoid wastage of memory
    4.this memory gets allocated the heap bloc

  • @shahrearjahan9159
    @shahrearjahan9159 2 года назад

    Ma'am..you deserve all the money that I gave to my University...

  • @jagjotsingh3600
    @jagjotsingh3600 2 года назад +1

    THE BEST TEACHER FOR DATA STRUCTURE AND C THAT I HAD EVER SEEN IS #JENNYMAM.

  • @vivek7935
    @vivek7935 2 года назад

    I love your lectures and your are gorgeous and awesome mam ,how you got that beauty and knowledge at the same time,most wanted mystery..

  • @RNTXvaldus
    @RNTXvaldus 2 года назад +1

    I'm here after your video goes viral on Instagram

  • @calebmuchiri8162
    @calebmuchiri8162 2 года назад +4

    Hi Jenny,thank you for the videos they're very helpful,kindly go through the memory layout .

  • @dishantitaliya1912
    @dishantitaliya1912 Год назад

    Thank you ma'am for well explanation.

  • @danishali-ol1vz
    @danishali-ol1vz 2 года назад

    Nice love and respect from Pak

  • @catherinemweenemilimo1222
    @catherinemweenemilimo1222 2 года назад

    You are a great teacher madam.

  • @hariparuchuru3858
    @hariparuchuru3858 2 года назад

    Some of the difference between SMA & DMA
    STATIC MEMORY ALLOCATION:
    Memory allocated at compile time
    Memory is alloted from STACK
    Fixed memory Allocation( can't change at anytime once initialized)
    Memory wastage happens
    We take variables, pointers etc...
    DYNAMIC MEMORY ALLOCATION:
    Memory allocated at runtime.
    Memory is alloted from HEAP
    Memory is not fixed we can change according to our requirements
    Efficient usage of memory
    To perform DMA we need a POINTER and these memory should be FREED during the program so that it can be reused again.

  • @sanskar6268
    @sanskar6268 2 года назад +1

    Didi, plz teach us C++ bcz ur explaining is awesome and I have easily learnt the concept of C programming bcz of you.😃

  • @__YashRaj
    @__YashRaj 2 года назад +5

    Mam kindly continue DAA series also...

  • @rasithnovfal1920
    @rasithnovfal1920 2 года назад

    Assignment:The difference between sma and dma is in sma the mem is allocated in the stack but we cant free the memory during the runtime means we cant reuse then in dma the mem is allocated in the heep part and it also provides a way to free the memory which can be reused....🤪

  • @Bipin67532
    @Bipin67532 2 года назад

    Thank you so much man🙏🤍
    Mam please make a video on ,
    Display the names in alphabetical order .
    Love form nepal 🇳🇵🤍

  • @anushmachandran1175
    @anushmachandran1175 Год назад

    Thank u ma'am,good explanation

  • @ravikantsain9520
    @ravikantsain9520 2 года назад

    You earned one more subscriber

  • @Manpreet_saini696
    @Manpreet_saini696 Год назад +2

    Sma=in sma we can allocate the memory from stack
    Dma=in dma we can allocate the memory from heap
    Sma=memory can be allocated at compile time
    Dma=memory can be allocated at run time
    Sma=memory can be wastage
    Dma=memory can be reused

  • @UniqueBeatbox
    @UniqueBeatbox 2 года назад

    Mai tou apko dekhne aya hu ☺️❤️

  • @PAMPYSUTRADHAR
    @PAMPYSUTRADHAR 3 месяца назад +1

    Mam how heap memory differs from stack memory?

  • @rameshnaidu8253
    @rameshnaidu8253 11 месяцев назад

    Super mam 💖

  • @jasheerali
    @jasheerali 2 года назад

    Please upload memory segment video, which will be really helpfull

  • @VishalKumar-ql2jt
    @VishalKumar-ql2jt 2 года назад +2

    Hello mam,
    Can you please tell me that how many videos are left in this C programming course and how much time is it gonna take to be completed

  • @birendrabiru8260
    @birendrabiru8260 2 года назад

    Thanks god every parents made each beautiful daughter's ❤️👌👌🙏🙏

  • @jstar2135
    @jstar2135 2 года назад +1

    Thank you mam.

  • @cricket_addicted_guys
    @cricket_addicted_guys 2 года назад

    Mam please upload the memory management in c language
    I need some more information about memory management for memory allocation in c.. Please make a video and upload as soon as possible.

  • @RATANAGARWALITINFORMER
    @RATANAGARWALITINFORMER 2 года назад

    v good description

  • @AmanDeep-mo6nv
    @AmanDeep-mo6nv Год назад

    Mam notes milaga 😊 thoda help hojata hamlog ka 🙏🏻

  • @sushamaavaghade9945
    @sushamaavaghade9945 Год назад

    Mam i want brief about memory represention... Plz make one seperate vedio on that

  • @PramodYadav-dr9vq
    @PramodYadav-dr9vq 2 года назад +1

    mam please one vedio related to memory types(stack,heap.....)and what section of program is stored in which memory

  • @saney5818
    @saney5818 2 года назад

    Like my computer memory is all full
    So does that means i can't do any programs or allocate memory for the program
    Like in software case?

  • @saibalam7852
    @saibalam7852 2 года назад +1

    Also make detail video on that 4 parts of the memory mam pls

  • @jamesbolakoknhial6943
    @jamesbolakoknhial6943 11 месяцев назад

    So interesting!

  • @rudhirmahalik
    @rudhirmahalik 2 года назад

    can we say that, to use the dynamic memory we have to access the static memory first then we can point to the DM using pointer......stating such will it be true.

  • @venumandadi31
    @venumandadi31 2 года назад +1

    Aravind is a nice guy

  • @chandrakantnorajappanavar8690
    @chandrakantnorajappanavar8690 Год назад

    So thanks mam❤

  • @talhashah3986
    @talhashah3986 Год назад

    12:05 Mam please make a detailed video on memory layout.

  • @vinayakumari2390
    @vinayakumari2390 2 года назад

    Madam in the book I read the free region is inbetween the stack and the permanent storage area but u said it is the first region. Which is correct please let me know.
    B

  • @ALL_I_KNOW_1172
    @ALL_I_KNOW_1172 2 года назад +1

    Mam,When will you complete this C programming videos completely

  • @futuretakgk7828
    @futuretakgk7828 2 года назад +1

    Very nice

  • @madhavinetha5839
    @madhavinetha5839 2 года назад +4

    Please explain memory segments in a seperate video ma'am

  • @halva_raj8859
    @halva_raj8859 2 года назад +1

    If u would posted this video 4 days ago.. I would gain 13 marks in my exam😭😭...

  • @sandeepkamal1694
    @sandeepkamal1694 2 года назад

    Good 👍

  • @vinayakumari2390
    @vinayakumari2390 2 года назад

    Madam if it is float or character then what is the fixed memory as ,4 for integer in static memory allocation.

  • @ianazraf
    @ianazraf 2 года назад

    U said that u have easy technique in solving the recurrence relation.. Please make a video of that..

  • @debojitacharjee
    @debojitacharjee 2 года назад

    *BUT A PROGRAM IS COMPILED TO MACHINE LANGUAGE ONLY WITHOUT EXECUTION* - compiler only converts the code to machine language and stores in a file but doesn't execute the program, then how STATIC memory is allocated? STATIC memory will be allocated only if it's defined in the code whether to allocate STATIC or DYNAMIC memory. For example, if thr size of an array was defined by any integer value in the code then STATIC memory will be allocated during execution. But if any variable is used to get the size from user input or from any other processing then it will be DYNAMIC allocation.

  • @godshivam1709
    @godshivam1709 Год назад +1

    Static memory location:-
    It is a process of allocating memory at run time of a program.
    Here memory sized is fixed and it can't be reused.
    Dynamic Memory Allocation:-
    Process of allocating and de allocating memory at run time of a program.
    Here , memory can be used again and again as it shows the property of reusability. 💯💥

  • @vicky_2143
    @vicky_2143 Год назад

    You are teaching very well mam.
    But the main thing is ,we are not able to concentrate on the board☺, because of your beauty is distracting on eyesight🤭

  • @coding-X-04
    @coding-X-04 2 года назад

    I am studying DS concept so this video is very useful to me but one day I will create a new data structure .