How processes get more memory. (mmap, brk)

Поділитися
Вставка
  • Опубліковано 15 кві 2018
  • Patreon ➤ / jacobsorber
    Courses ➤ jacobsorber.thinkific.com
    Website ➤ www.jacobsorber.com
    ---
    We've all called malloc to get more memory for our programs, but what is REALLY happening when we call malloc? This video goes under the hood and shows you how a computer process (running computer program) gets more memory from the operating system.
    ***
    Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
    About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
    More about me and what I do:
    people.cs.clemson.edu/~jsorber/
    persist.cs.clemson.edu/ Note that any Amazon links in my video descriptions are generated by Amazon. If you click one of them and then buy something it helps support this channel. Thanks.
    ***
    Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
    About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
    More about me and what I do:
    www.jacobsorber.com
    people.cs.clemson.edu/~jsorber/
    persist.cs.clemson.edu/
    To Support the Channel:
    + like, subscribe, spread the word
    + contribute via Patreon --- [ / jacobsorber ]
    + rep the channel with nerdy merch --- [teespring.com/stores/jacob-so...]
    Source code is also available to Patreon supporters. --- [jsorber-youtube-source.heroku...]
    Want me to review your code?
    Email the code to js.reviews.code@gmail.com. Code should be simple and in one of the following languages: C, C++, python, java, ruby. You must be the author of the code and have rights to post it. Please include the following statement in your email: "I attest that this is my code, and I hereby give Jacob Sorber the right to use, review, post, comment on, and modify this code on his videos."
    You can also find more info about code reviews here.
    • I want to review your ...

КОМЕНТАРІ • 85

  • @akj7
    @akj7 4 роки тому +68

    You should have also mentioned what malloc actually writes into the memory, which is why free doesn't need a size.

  • @odaialkhodary7872

    I just stumbled upon one of your videos, and man, I went down a rabbit hole with your excellent guidance! Your explanations are so clear and thorough; Thanks for breaking down complex concepts into digestible bits. Your passion for teaching really shines through, and it's making a huge difference in my understanding. Keep up the fantastic work!

  • @anshumansingh6252
    @anshumansingh6252 3 роки тому +4

    What a crisp and clean explanation! I am impressed man. Thanks a ton.

  • @SRedienhcs
    @SRedienhcs 4 роки тому +2

    Awesome! I've been looking for a good presentation of this topic for days. Subscribed!

  • @gowthamanv8740
    @gowthamanv8740 4 роки тому +19

    Your way of presentation Awesome. Keep doing more videos. I subscribed.

  • @qaiyyumhakimi7947
    @qaiyyumhakimi7947 4 роки тому +24

    Your way of explaining things is one of the best that i've found on youtube! Thumbs Up!

  • @mhanna2
    @mhanna2 6 років тому +19

    Found this helpful and enjoyable, thank you!

  • @WatchTower71
    @WatchTower71 4 роки тому +5

    Holy dang dude, you’re literally the most knowledgeable person about C libraries I’ve seen on UA-cam! You should be a teacher or something. Great videos, please keep em coming!

  • @RegularObamahedron
    @RegularObamahedron 3 роки тому +1

    Clean presentation!

  • @nupurgupta6373
    @nupurgupta6373 4 роки тому +1

    amazing information , please more videos on mmap

  • @saurabhshrivastava224
    @saurabhshrivastava224 3 роки тому

    Great brother. Keep on doing more..

  • @shushens
    @shushens 3 роки тому

    This is a fantastic video. One of the best you made yet. Strangely, it is one of the videos I watched last.

  • @lllbenderlll
    @lllbenderlll 4 роки тому

    please don't stop.

  • @gonzajuarez4918
    @gonzajuarez4918 3 роки тому +5

    hello, been really enjoying your videos and learning a lot. i've got a question though: should we use munmap once we finished? kinda like free() is used after malloc(). and if so, is it the same for brk/sbrk (like can sbrk called to shrink or does it have a shrinking counterpart). I've done a bit of strace and found than munmap is in fact called by free() but haven't seen a counterpart with brk sbrk (or something like calling sbrk with a negative number perhaps as two's complement of the initially allocated memory)

  • @MrUmang40
    @MrUmang40 5 років тому +2

    You are my life savior......your every teaching helps me move a step ahead....you came late on UA-cam.....but at least you came......love you sir.....

  • @OretYT
    @OretYT 5 років тому +1

    Great video

  • @kathiravankathir3089
    @kathiravankathir3089 5 років тому +4

    your profile is awesome

  • @44r0n-9
    @44r0n-9 4 роки тому +1

    This video is perfect.

  • @ruynobrega6918
    @ruynobrega6918 Рік тому

    Great content, as always. If you can answer me: could you explain how actual RAM dump actually works? I always wondered that bc of the Program Break.

  • @majdwatad
    @majdwatad 5 років тому +1

    Thanks for the video