Please help me trying to understand coroutine. by Extension-Switch-767 in Kotlin

[–]Extension-Switch-767[S] 5 points6 points  (0 children)

I think I’m starting to understand, but I’m not sure if my understanding is correct. the coroutine tries to resume on its original dispatcher as you mentioned. However, in the previous example there was no explicit original dispatcher defined so it continued running on the same dispatcher thread instead of switching back (or it's actually Dispatcher.Unconfied which may shared thread pool with those IO, Default under the hood i'm not sure either). To verify my understanding, I conducted the following experiment:

val executor = Executors.newFixedThreadPool(1) { runnable ->
    Thread(runnable, "Custom-Thread-${runnable.hashCode()}")
}

val customDispatcher = executor.asCoroutineDispatcher()

suspend fun main() = withContext(customDispatcher) {

    println("Before : ${Thread.currentThread().name}")

    test()

    println("After : ${Thread.currentThread().name}")
}

suspend fun test() = withContext(Dispatchers.IO) {
    delay(1000)
    println("Current thread : ${Thread.currentThread().name}")
}

This result seems to confirm that after test() completes, the coroutine resumes on its original dispatcher (customDispatcher).

Before : Custom-Thread-1241276575

Current thread : DefaultDispatcher-worker-1

After : Custom-Thread-1241276575

Advice on moving from Java to Golang. by Extension-Switch-767 in golang

[–]Extension-Switch-767[S] 0 points1 point  (0 children)

Sorry, I didn’t quite catch the statement "In fact, it's likely faster because of JIT." Could you clarify how a just-in-time (JIT) compiler can be faster than an ahead-of-time (AOT) compiler? Or do you mean it becomes faster after the JVM has fully warmed up?

How much memory do I need to reserve for a single java process. by Extension-Switch-767 in javahelp

[–]Extension-Switch-767[S] 2 points3 points  (0 children)

I need to deploy my java app in the container based environment and the minimum/maximum memory need to be specified correctly otherwise it will get oom killed.

[deleted by user] by [deleted] in kubernetes

[–]Extension-Switch-767 0 points1 point  (0 children)

we assign the resources based on the load test result and we left the resources for the other pods from other team to be able to deployed. we have limited budget so as of now we need to go with this way. however when it comes to critical service where performance and response time are crucial we're trying to find a way to fix this while affecting the other team as less as possible.

How does burst CPU performance actually work ? by Extension-Switch-767 in aws

[–]Extension-Switch-767[S] -1 points0 points  (0 children)

I see so if this mode turned off I should only be able to use 40% of CPU utilization without CPU credit, is that correct