Kotlin Coroutines: 100,000 Coroutines vs. Threads: The Memory Battle

Поділитися
Вставка
  • Опубліковано 7 тра 2024
  • In this video, we delve into the fascinating world of concurrency in Kotlin and Java. We start by creating a whopping 100,000 coroutines and threads to see how they handle the workload. As we watch, a clear winner emerges: Kotlin coroutines. While Kotlin effortlessly handles the massive workload without breaking a sweat, Java threads struggle, leading to an out-of-memory exception. Why is this the case?
    Checkout latest Android Architecture Course
    👉 Architecting Excellence: A Deep Dive into Multi-Module Android Apps: • Architecting Excellenc...
    👉 Check out your Ultimate Android Interview Questions Guide for Beginners
    www.simplifiedcoding.net/andr...
    🌟 Support the Journey! ☕💖
    Creating these courses is a labor of love, and your support means the world! 🌍✨ If you've found value in the "Ultimate Android App Creation Journey" and want to ensure more fantastic content, consider buying me a coffee on
    *BuyMeACoffee* 👉 www.buymeacoffee.com/probelal...
    ☕ Every sip fuels the effort behind each lesson, tutorial, and line of code that goes into these courses. Your contribution helps maintain the energy and dedication required to bring you top-notch learning experiences. 🚀👨‍💻 Your support is not just a donation; it's a vote of confidence in the continuous journey of knowledge sharing. Let's brew success together! ☕💪💙
    Explore more learning adventures with these courses:
    👉 Architecting Excellence: A Deep Dive into Multi-Module Android Apps: • Architecting Excellenc...
    👉 Dart Programming Tutorial: • Dart Programming Tutor...
    👉 Kotlin Programming Tutorial: • Kotlin Android Tutoria...
    👉 Android MVVM Tutorial: • #1 Android Login/Signu...
    👉 Android Game Development Tutorial: • Android Game Developme...
    👉 Retrofit Android Tutorial: • #1 Retrofit Android Tu...
    👉 Android RecyclerView Tutorial: • Android RecyclerView T...
    👉 Android Room Tutorial: • Android Room Tutorial ...
    👉 Firebase Auth Tutorial: • Firebase Authenticatio...
    👉 Android Notification Tutorial: • Android Notification T...
    👉 Build Tic Tac Toe in Android: • #1 Android Tic Tac Toe...
    Sending heaps of love and gratitude for your continued support! ❤️❤️
    #KotlinCoroutines #JavaThreads #Concurrency #Efficiency #OutOfMemory #MemoryManagement #Programming #Developer #Java #Kotlin #CoroutinesVsThreads #ConcurrencyRevolution #MemoryEfficiency #ProgrammingLanguages #DeveloperCommunity #TechComparison #JavaDevelopment #KotlinDevelopment #EfficientCoding #ProgrammingTips
  • Наука та технологія

КОМЕНТАРІ • 8

  • @vengateshm2122
    @vengateshm2122 2 місяці тому +3

    Coroutines are light weight threads that are create on top the platform threads. Coroutine can suspend on one thread and resume on same or other thread.

  • @vegadhardik
    @vegadhardik Місяць тому +1

    Thread has its own stack and each thread is allocated its own memory space, Where as Coroutines are underlined with a single Thread that is why it does not require large space and memory.
    I think context switching also plays a crucial role, Coroutines can be suspended to make context switching where Threads requires explicit context switching.
    Suggestions accepted.

  • @boredSoloDev
    @boredSoloDev 2 місяці тому +1

    I dead ass thought you said "photo bean" in the beginning of the video and was so confused.
    But this is very valid information

  • @roushanali1918
    @roushanali1918 2 місяці тому

    You question good question. Your question very good question 😅

  • @ryugalaw
    @ryugalaw 2 місяці тому +1

    Why?
    This is awesome

    • @SimplifiedCoding
      @SimplifiedCoding  2 місяці тому

      You should comment the reason why we can launch 100000 coroutines but not 100000 threads

    • @ryugalaw
      @ryugalaw 2 місяці тому

      @@SimplifiedCoding I honestly don't know. I use Kotlin, but not very good with Coroutines.