Java Memory Model in 10 minutes

Ғылым және технология

Java Memory Model is a set of rules all JVMs have to follow to ensure correct working of our concurrent programs.
More resources:
2016.javazone.no/program/the-...
shipilev.net/blog/2014/safe-p...
www.cs.umd.edu/~pugh/java/mem...
docs.oracle.com/javase/specs/...
Channel
----------------------------------
Complex concepts explained in short & simple manner. Topics include Java Concurrency, Spring Boot, Microservices, Distributed Systems etc. Feel free to ask any doubts in the comments. Also happy to take requests for new videos.
Subscribe or explore the channel - / defogtech
New video added every weekend.
Popular Videos
----------------------------------
What is an API Gateway - • What is an API Gateway?
Executor Service - • Java ExecutorService -...
Introduction to CompletableFuture - • Introduction to Comple...
Java Memory Model in 10 minutes - • Java Memory Model in 1...
Volatile vs Atomic - • Using volatile vs Atom...
What is Spring Webflux - • What is Spring Webflux...
Java Concurrency Interview question - • Java Concurrency Inter...

Пікірлер: 203

  • @70ME3E
    @70ME3E4 жыл бұрын

    I'm going through this playlist to learn Java concurrency, and I have to say your explanation and presentation quality are amazing, and the diagrams are really helpful. thank you!

  • @DefogTech

    @DefogTech

    4 жыл бұрын

    Wow, thanks!

  • @mohammedrahamathulla4040

    @mohammedrahamathulla4040

    3 жыл бұрын

    @@DefogTech Why no videos from you😔?? All your subscribers are waiting

  • @suhani091088
    @suhani0910884 жыл бұрын

    Always read these topic therotically, but could never visualise it like this you have explained..Great presentation man!

  • @rohitsharma-xt8qe
    @rohitsharma-xt8qe5 жыл бұрын

    I have never seen such an excellent explanation of JMM. Thanks a lot

  • @Machinerium
    @Machinerium5 жыл бұрын

    I had an interview question like that.. This is a very clean explanation , keep doing it!

  • @tanoysaha7410
    @tanoysaha74104 жыл бұрын

    Your explanations are precise, but have so in-depth/hidden informations and moreover so easy to understand

  • @mrchief3383
    @mrchief33833 жыл бұрын

    Man, you are awesome. I was struggling trying to understand atomic operations and the use cases of volatile variables. Thank you so much

  • @NaturalPro100
    @NaturalPro1005 жыл бұрын

    The best video i could find on youtube.

  • @TauCu
    @TauCu4 жыл бұрын

    This helped me understand a lot about the JVM Thanks, you're very good at explaining things without any unneeded gibberish!

  • @DrAkyla1123
    @DrAkyla11235 жыл бұрын

    Very concise and easy to grasp. Great job!

  • @monishchhadwa777
    @monishchhadwa7773 ай бұрын

    I would absolutely recommend all Java engineers-whether junior or very senior-to watch this!

  • @shellindebted5328
    @shellindebted53286 жыл бұрын

    I tried multiple times myself to understand JMM, But this is the first time i got to learn something about them. Excellent Presentation. Hats of to you, You define perfection!!

  • @DefogTech

    @DefogTech

    6 жыл бұрын

    I am far from perfect. Though, thanks much for the kind words sir!

  • @yifei663

    @yifei663

    5 жыл бұрын

    May be you should read java language specification : docs.oracle.com/javase/specs/jls/se8/html/jls-17.html .

  • @skaLife
    @skaLife4 жыл бұрын

    You have a good teacher in you. Please continue the good work.

  • @viveksingh9120
    @viveksingh91205 жыл бұрын

    Awesome mate. You are really doing great, very impressive

  • @rajasruji2476
    @rajasruji24762 жыл бұрын

    Wow…. Such an well articulated video. I felt this topic to be very difficult to understand before I watched your video. Please sir keep adding more and more topics to this channel. For the first time fell in love with subject videos.

  • @anilkinikar
    @anilkinikar5 жыл бұрын

    Awesome clarity. Voice is very clear and videos are well designed. Subscribed 👍

  • @sandeepkumarsahoo3458
    @sandeepkumarsahoo34584 жыл бұрын

    Crystal clear explaination... Loved it

  • @Lucky-uz3je
    @Lucky-uz3je5 жыл бұрын

    You are my interview trainer...love you bro:)

  • @paneerdopyaaza2914
    @paneerdopyaaza29143 жыл бұрын

    Please make a whole course...I will definitely try buying it.Your videos are just awesome.

  • @sumitbabel5415
    @sumitbabel54153 жыл бұрын

    Honestly exceptionally well explained Sir, hats off

  • @kakashihatake4840
    @kakashihatake48406 жыл бұрын

    Really loved the explanation. Thank you

  • @edeepakjain
    @edeepakjain4 жыл бұрын

    Best explanation of volatile so far... 👌

  • @perrym8048
    @perrym80485 ай бұрын

    Best explanation I've seen, great work!

  • @VikiSangani
    @VikiSangani5 жыл бұрын

    Very nicely explained. Please keep making such videos.👍👍

  • @iknowyourerightbut6246
    @iknowyourerightbut62465 жыл бұрын

    future me: volatile has semantics for memory visibility. Basically, the value of a volatile field becomes visible to all readers (other threads in particular) after a write operation completes on it. Without volatile, readers could see some non-updated value.

  • @narendrasriram
    @narendrasriram5 ай бұрын

    This playlist you have made is too awesome. your example/explanation for happens-before has a few issues. Not sure if I understood wrong, otherwise.Thank you so much for this playslit.

  • @venu5791
    @venu57914 жыл бұрын

    Thanks for sharing this concept. I had only some theoretical knowledge of this before I watch this imp video.

  • @StyleTrick
    @StyleTrick4 жыл бұрын

    Hey great videos as always! I just wanted to ask, since primitives are passed by value and Objects are passed as reference, does the JVM only cache primitives into a threads local cache? If the value being updated was an Integer Object, e.g. new Integer(1), it would not need flushing as the object is passed by REFERENCE?

  • @tarang65
    @tarang653 жыл бұрын

    Amazing presentation. All the videos are really helpful. Great work.

  • @Admiral.MacDonnell
    @Admiral.MacDonnell4 ай бұрын

    My takeaway - if the tasks perform blocking IO operation, I should not use fork join pool. so true. Thanks for the explanation! You have a gift of mixing complicated concept easy to digest!

  • @kotojava
    @kotojava2 жыл бұрын

    this channel deserve much more subscribers.

  • @bhavyashah2630
    @bhavyashah26306 жыл бұрын

    Awesome video...Please don't stop making such excellent videos.

  • @DefogTech

    @DefogTech

    6 жыл бұрын

    Thank you for the motivation sir!

  • @gurupadamgundala5142

    @gurupadamgundala5142

    5 жыл бұрын

    Please make more videos

  • @ITech2005

    @ITech2005

    5 жыл бұрын

    Defog Tech More videos :)

  • @saravanprathi6956

    @saravanprathi6956

    3 жыл бұрын

    More videos pleaseeeee

  • @nlarralde
    @nlarralde2 жыл бұрын

    Great video, very clear explanation and examples. Thank you

  • @gauravbajpai6890
    @gauravbajpai68905 жыл бұрын

    U earned a fan today - Subscribed !

  • @prashanttiwari120
    @prashanttiwari1203 жыл бұрын

    Best video on java on whole KZread universe

  • @shobhitmittal77
    @shobhitmittal774 жыл бұрын

    This is one ultimate video...subscribed !!

  • @vikramreddy7586
    @vikramreddy75863 жыл бұрын

    This video is pure GOLD!!!

  • @SatyaprasadMr
    @SatyaprasadMr4 жыл бұрын

    Videos are very useful. Crisp & Clear. I request to make more videos

  • @purnimadas3762
    @purnimadas37625 жыл бұрын

    That was really good. Thanks for posting, excellent, clear and to the point presentation, good job!

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Thank you

  • @mujahidshaikh5034
    @mujahidshaikh50343 жыл бұрын

    everything to the point.. love ur videos bro❤️

  • @jeremythen7239
    @jeremythen72395 жыл бұрын

    Best explanations! Keep it up.

  • @noortech254
    @noortech2543 жыл бұрын

    Bro You are simply amazing. You may be not realised how much you are helping us. Thank You bhai :D

  • @masteradityamishra9486
    @masteradityamishra94865 жыл бұрын

    Very nice explanation appreciate it, thanks.

  • @abhik9450
    @abhik94504 жыл бұрын

    Thanks for a proper explanation on happens-before 🙂

  • @umeriqbal5662
    @umeriqbal56624 жыл бұрын

    Jigger u r love... Awesome video.... Amazing teaching skills... Thanks a lot

  • @ivanevseevv
    @ivanevseevv3 жыл бұрын

    Explanation is very good and sharp!

  • @hakura88
    @hakura88 Жыл бұрын

    love your simple examples. thank you

  • @Dedeepya9
    @Dedeepya95 жыл бұрын

    Started watching thread pool videos Nd then addicted to all of ur videos Nd subscribed..the way of explanation is precise , innovative Nd interesting.your wrk deserves more than a thnks..

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Thank you for the kind words!! I am so happy its helping everyone

  • @sepraveen

    @sepraveen

    4 жыл бұрын

    Yes are techie by heart

  • @prasantkumar7693
    @prasantkumar76935 жыл бұрын

    Thank you for nice explanation and make more videos.

  • @pogrommist
    @pogrommist3 жыл бұрын

    Awesome explanation and examples!

  • @saravanprathi6956
    @saravanprathi69563 жыл бұрын

    You are a fantastic teacher.. please please make more videos

  • @sshks10
    @sshks103 жыл бұрын

    Very good and simple explanation

  • @thomashpfner-dahl1433
    @thomashpfner-dahl14335 жыл бұрын

    Dude!! You are awesome, a true lifesaver. You are the first that have made it simple, at least that I have come across

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Thanks much buddy!

  • @isayanpal
    @isayanpal Жыл бұрын

    You're just brilliant! 🙏🏽

  • @vijayp6810
    @vijayp68104 жыл бұрын

    Learnt new information..thank you so much

  • @harish7706
    @harish77065 жыл бұрын

    I have been going through a lot of JAVA topic videos in different forums, by far Defog Tech is the best that I have come across. Advanced topics explained in a simple way which provides clarity. Keep going

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Thank you for the kind words sir!

  • @ibrahimshaikh3642
    @ibrahimshaikh36423 жыл бұрын

    Thank u, waiting for more videos on java

  • @mehulmakwana7091
    @mehulmakwana70914 жыл бұрын

    Awesome explanation buddy. thanks a lot. :)

  • @ardiansyah6794
    @ardiansyah67944 жыл бұрын

    Oh thanks man. I wish you were my lecturer 😀

  • @jiteshkumar3387
    @jiteshkumar33873 жыл бұрын

    Good explanation !! :) Very usefull

  • @MarkGla55
    @MarkGla552 жыл бұрын

    Excellent explanation. Thank you

  • @sivagurunathanparanitharan4714
    @sivagurunathanparanitharan47144 жыл бұрын

    🙏 You are the Best Teacher that I have ever seen.🥇, A classical method of approach = Superb indeed.👌.🎯Please Could you kindly teach us Flutter & Dart & Go lang & Scala too . Pleeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeese Sir..... 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

  • @__nitinkumar__
    @__nitinkumar__2 жыл бұрын

    2:50 loved this diagram man.

  • @vijaykumarreddyt3287
    @vijaykumarreddyt3287 Жыл бұрын

    You are doing Great! Dude

  • @coreyhartman4510
    @coreyhartman45104 жыл бұрын

    This video is excellent.

  • @Jayantch.999
    @Jayantch.9993 жыл бұрын

    Super explanation 👍

  • @Murga_Mutton
    @Murga_Mutton3 жыл бұрын

    Hi, Thanks for the video. How is the volatile or synchronized or lock usage different from having the field in the constructor? Can't the shared cache object be used by putting the field in the constructor method and calling it in different threads?

  • @niftymiller6057
    @niftymiller60575 жыл бұрын

    Very good and crisp way of explanation. Keep doing this good :) work

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Thank you!

  • @studio2038
    @studio20384 жыл бұрын

    very simple to understand

  • @MoBeigi
    @MoBeigi4 жыл бұрын

    Very good video, thank you!

  • @SagarBorseTheGeek
    @SagarBorseTheGeek5 жыл бұрын

    Excellent explanation

  • @manognajoshik8465
    @manognajoshik84652 жыл бұрын

    Thank you very much sir!! You are amazing ❤️

  • @kannadasans7564
    @kannadasans75644 жыл бұрын

    Could you make a samples of reactive programming followed by your aka Java fiber videos. For eg, How to use RxJava for the below categories of apps, 1. Considering both frontend and backend 2. Considering there is no frontend and it's purely backend app. Doing good job. Really great👍

  • @sriram6148
    @sriram61482 жыл бұрын

    Amazing!!! You rock!

  • @anugrah.singhal
    @anugrah.singhal3 жыл бұрын

    Very good content 😊

  • @sbylk99
    @sbylk995 жыл бұрын

    Great tutorial, thank you SIR!

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    You're very welcome!

  • @andrii5866
    @andrii58663 жыл бұрын

    Awesome. Thanks man!

  • @narendramanikanta7597
    @narendramanikanta75975 жыл бұрын

    Awesome explanation mate. God bless you

  • @pradhumansingh1195
    @pradhumansingh11953 жыл бұрын

    Who the hell dislikes such a great videos??

  • @devendrawangikar2890

    @devendrawangikar2890

    3 жыл бұрын

    other video makers :)

  • @tejasdoond7614
    @tejasdoond76146 жыл бұрын

    Awesome dude... Helped a lot

  • @DefogTech

    @DefogTech

    6 жыл бұрын

    Glad it helped. Thank you!

  • @kakashihatake4840
    @kakashihatake48406 жыл бұрын

    Please do more such videos

  • @pkbkarpr
    @pkbkarpr3 жыл бұрын

    Short and Sweet

  • @user-cf6ts2sc5x
    @user-cf6ts2sc5x3 ай бұрын

    good job, man!

  • @yxx5326
    @yxx53265 жыл бұрын

    Thank you! Really like your explanation.

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    You're welcome! I'm happy you liked it

  • @studio2038
    @studio20384 жыл бұрын

    nice explanation

  • @gurupadamgundala5142
    @gurupadamgundala51425 жыл бұрын

    Awesome. Expected more videsos 👌👌👌

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Thank you sir!

  • @aniln4736
    @aniln47364 жыл бұрын

    In my case there is concurrent hashmap obj that holds configurations read from different server. Quartz scheduler will fetch configuration data for every 30 sec and update a new data (whole obj) to this concurrent hashmap.. In this case ,in my opinion voltaile should be used to always get the updated obj to the reader threads but some quality checking tools raising it as bug So any suggestions during this scenario

  • @myvinbarboza3038
    @myvinbarboza30384 жыл бұрын

    Your the best man 😀

  • @mostinho7
    @mostinho74 жыл бұрын

    2:10 each core has its own cache and then there are shared caches. Thread running on core changes the variable in its local cache only, volatile keyword makes sure variable is flushed to shared cache when thread changes it so that changes are visible to all the other threads 6:05 happens before relationship 9:30 volatile keyword example

  • @monstersmiled648

    @monstersmiled648

    4 жыл бұрын

    Hi can you help me I am confused when i was trying real time as per the diagram in the time 00:03:52 here i used this... System.out.println("the writerThread x is: "+x); System.out.println("the readerThread r2 is:"+r2); --------------------------------------------------------------------------------------------------------------------------------- like in this program(below): public class FieldVisibility { int x = 0; public void writerThread() { x = 1; System.out.println("the writerThread x is: "+x); } public void readerThread() { int r2 = x; System.out.println("the readerThread r2 is:"+x); } } output is:-- the writerThread x is: 1 the readerThread r2 is:1 ....................................................................................... instead of the writerThread x is: 1 the readerThread r2 is:0

  • @ganeshpathak4804
    @ganeshpathak48045 жыл бұрын

    Hi, I have one request if you could make a video on Performance improvement techniques. Not necessarily related to threading but in general. I am sure everyone would be benefited as you explain complex things in very simple way :)

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Sure, sounds like a good idea. Will add it to the list

  • @bluecomment6146
    @bluecomment61462 жыл бұрын

    Superb video

  • @BeatSyncBytes
    @BeatSyncBytes3 жыл бұрын

    Explaination with L2 and L3 is so deep. How do you get so deep

  • @mahendrakhedhar6054
    @mahendrakhedhar60545 жыл бұрын

    read write barrier means what sir please explain if we use volatile what happens to those barriers

  • @RobinsonGames
    @RobinsonGames4 жыл бұрын

    Really good explanation with a good visual display of those

  • @suhaspartha2908
    @suhaspartha29083 жыл бұрын

    Superb!

  • @uka0002
    @uka00024 жыл бұрын

    Great video

  • @dinkarinjosh
    @dinkarinjosh4 жыл бұрын

    can you please make a video on working of JVM and its architecture? btw good job.

  • @shilpaagrawal7126
    @shilpaagrawal71264 жыл бұрын

    Awesome video... Can u also make video on design patterns ...?

  • @philthehuman
    @philthehuman5 жыл бұрын

    Very clear video, though I would like suggest you to fix the code examples of locks or at least to have a disclaimer by voice that no one should use locks by your examples and should read a documentation instead which says you have to use "try { .. } finally { lock.unlock(); }" construct.

  • @DefogTech

    @DefogTech

    5 жыл бұрын

    Agreed. Will add a card to the video. Thanks!

  • @AmitGadaley17
    @AmitGadaley173 жыл бұрын

    Hi, Could you please make a video on memory management in java or provide a useful link for it. Thanks!!

  • @khushbuchoudhary5185
    @khushbuchoudhary51853 жыл бұрын

    Super video! I applauded for ₹40.00 👏

Келесі