DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library
Core Badge
Avatar

Petr Bouda

DZone Core CORE

Java Developer at Freelancer

Prague, CZ

Joined Apr 2013

https://github.com/petrbouda

About

Java/JVM Enthusiast, Blogger

Stats

Reputation: 954
Pageviews: 621.8K
Articles: 15
Comments: 20
  • Articles
  • Comments

Articles

article thumbnail
How to Generate Flame Graphs in Java
This article describes generating flame graphs in Java, discusses options, and in which use cases we could take advantage of it.
July 30, 2024
· 10,072 Views · 7 Likes
article thumbnail
Native Memory Allocation in Java
In this article, we discuss how to better manage native memory within your containers to avoid common pitfalls.
March 18, 2020
· 23,268 Views · 10 Likes
article thumbnail
Pros and Cons for Using GraalVM Native-Images
Native image is a utility for converting Java applications into fully compiled binary code which is called native-image.
February 20, 2020
· 66,997 Views · 32 Likes
article thumbnail
Principles to Handle Thousands of Connections in Java Using Netty
Learn common principles for building scalable applications that handle thousands of connections.
Updated January 31, 2020
· 92,204 Views · 41 Likes
article thumbnail
Digging Into Sockets With Java Flight Recorder
Let's look at one amazing tool for gathering information about what's going on in your JVM — the Java Flight Recorder.
January 17, 2020
· 16,579 Views · 9 Likes
article thumbnail
Programming Models for Servers in Java
Learn more about various programming models for servers in Java!
Updated November 5, 2019
· 55,583 Views · 30 Likes
article thumbnail
Get Your Internal Queues Under Control in Java
There are a lot of reasons why you should be using internal queues in your program.
June 20, 2019
· 18,059 Views · 4 Likes
article thumbnail
Be Aware of ForkJoinPool#commonPool()
Learn more about how to deal with thread-pools in Java.
June 11, 2019
· 113,394 Views · 18 Likes
article thumbnail
How Much Memory Does a Java Thread Take?
Learn more about Java thread memory consumption.
Updated June 10, 2019
· 87,196 Views · 26 Likes
article thumbnail
How to Split Up Synchronous and Asynchronous Parts of Your System in Java
Learn how you can split up your system by synchronous and asynchronous parts using Java.
Updated June 6, 2019
· 28,345 Views · 13 Likes
article thumbnail
Increase Throughput by Eliminating Blocking Code in Your Java REST App
Blocking code is every bit a hinderance to your thoroughput as it sounds. See how you can get rid of it here.
June 5, 2019
· 12,779 Views · 6 Likes
article thumbnail
Save Your Memory in JVM with Atomic*FieldUpdater
Learn how to be memory efficient when writing Java code with Atomic*FieldUpdater.
May 30, 2019
· 13,776 Views · 10 Likes
article thumbnail
Final Keyword and JVM Memory Impact
Learn more about using the final keyword and how it can impact JVM memory.
Updated May 29, 2019
· 26,879 Views · 19 Likes
article thumbnail
Pitfalls in JVM and Docker Defaults
Here are some of the common pitfalls among Docker defaults in the JVM.
May 27, 2019
· 25,939 Views · 11 Likes
article thumbnail
Boost of Parallelism Using Producer/Consumer Pattern
Here are some of the effects of and use cases which would be fit for using the Producer/Consumer pattern.
May 15, 2019
· 10,642 Views · 4 Likes

Comments

Programming Models for Servers in Java

Nov 21, 2019 · Petr Bouda

haha I know but it still not here and adaptation will be loong :) .. and still does not support all the cases where you can become blocked.

Programming Models for Servers in Java

Nov 07, 2019 · Petr Bouda

Yes exactly, and the work on Asynchronous JDBC has been already stopped in a favour of coming Fibers :) - https://blogs.oracle.com/java/jdbc-next:-a-new-asynchronous-api-for-connecting-to-a-database

How Much Memory Does a Java Thread Take?

Jun 11, 2019 · Petr Bouda

Native Memory Tracking

- it tracks native memory of the JVM

- but as far as I know it's only internal JVM native memory, if you create your own native memory allocation then it's not included

How Much Memory Does a Java Thread Take?

Jun 08, 2019 · Petr Bouda

So that's the answer!!

I thought that the Committed memory is automatically set to 1MB when the thread is created but it looks you are right! Thank you for your answer and explanation, I'll update the article :)

How Much Memory Does a Java Thread Take?

Jun 08, 2019 · Petr Bouda

That's very interesting, thank you for your hint, I'll try to repeat the example with Zulu version. My example uses Oracle Hotspot.

How Much Memory Does a Java Thread Take?

Jun 08, 2019 · Petr Bouda

what version of Java?

How to Split Up Synchronous and Asynchronous Parts of Your System in Java

Jun 06, 2019 · Petr Bouda

Hey Brian, I think this is only one of the approaches. It depends on what you want to do in the asynchronous part of your system. Let's say you are pushing entity (a picture) and you want to put it into the queue where 5 services will asynchronously consume this but only one is supposed to respond back (the crucial one - we always need to know if this services processed successfully). This way you can exploit a lot of advantages of queues ... e.g. persist the entity and process it later on. It's about your use-case :) .. I prefer not to bind services together with a synchronous execution and make a split as soon as possible, in this case in Rest APP to open the door for asynchronous chaos :) ... of course, you always need to wait for the response somewhere because of synchronous HTTP (if you don't use push model - SSE or WebSockets)

How Much Memory Does a Java Thread Take?

Jun 06, 2019 · Petr Bouda

sorry, don't understand :)

How Much Memory Does a Java Thread Take?

Jun 06, 2019 · Petr Bouda

Hey Bro :) ... hope you don't maintain any stuff in Java 8 anymore :)

How Much Memory Does a Java Thread Take?

Jun 05, 2019 · Petr Bouda

I am not a JVM expert but I would distinguish Allocated and Committed, we can see that in Java 8 JVM commits automatically 1MB per thread during the creation of the thread even if it's not fully allocated (used) but in Java 11 gradually commit the memory according to allocation - at least what I saw when I was doing my experiment.

Increase Throughput by Eliminating Blocking Code in Your Java REST App

Jun 05, 2019 · Petr Bouda

If you want to try interactive flame graphs, please, click on links below, right click on SVG and open it in a new tab.
https://github.com/petrbouda/rabbitmq-async-microservices/blob/master/blocking.svg
https://github.com/petrbouda/rabbitmq-async-microservices/blob/master/non-blocking.svg

How Much Memory Does a Java Thread Take?

Jun 04, 2019 · Petr Bouda

You mean how the memory grows? The memory is not committed as whole at the very beginning of thread creation, it's committed after a smaller chunks, unfortunatelly I don't know tje algorithm behind this. However it's great, for example if you have let's say OpenShift and you specify that your application requests 500MB but can grow to 1GB then if your application creates a thread and don't actually use the threads (e.g. you have test environment which is mostly inactive) then your apps can report smaller amount of memory.

How Much Memory Does a Java Thread Take?

Jun 04, 2019 · Petr Bouda

You mean, how fast does the thread commit the memory? in Java 8 it's automatically 1MB in Java 11 it gradually takes until 1MB, unfortunatelly I didn't find any article or JEP describing this process.

Final Keyword and JVM Memory Impact

Jun 01, 2019 · Petr Bouda

I don't wanna talk on behalf of other languages but, as far as I know, Java can figure out "effectively final" variables only inside methods. And if we are talking about Java Memory Model then it does not matter because you are still thread-confined. This article makes sense only in a case of global variables.

Final Keyword and JVM Memory Impact

Jun 01, 2019 · Petr Bouda

Yes, you are right! It's swapped, thanks! It always somehow limits possibilities to reorder the code because you introduce barriers in your code. However, it's a tiny impact for the great predictability of your code.
The problem is that JVM does absolutely no optimizations on FINAL keyword because it behaves very defensively "thanks to" frameworks like Spring which are based on making even final fields accessible to put some value there.

Generating Setters and Getters Using Java::Geci

May 31, 2019 · Lindsay Burk

why another generator :( ... What is the support in Intellij idea, does it hide the class and field usage or saying that the class is used but is used only in generated code? Isn't better to use let's say .. Kotlin?

Final Keyword and JVM Memory Impact

May 31, 2019 · Petr Bouda

Exactly, a lot of stuff is hidden inside frameworks to make it "convenient" which is great for helloworld app, but in the end, we need to know what happens under the hood when the application is under the pressure!

Introduction to Lombok

May 16, 2019 · Brian Hannaway

Yeap I know that there is Intellij Lombok plugin, but it hides the information that the getter and field is not used :(

Introduction to Lombok

May 16, 2019 · Brian Hannaway

Maybe you are right, hopefully, Lombok will stay simple (a lot of interesting frameworks started being simple and awesome and then contributors start adding complexity/features :) ) ... I see the different problem but maybe it's not a problem with Lombok, maybe just Lombok's users just tend to do so - my colleagues omit to add a final keyword, they want to have as small source code as possible and just add @Data annotation :)


Introduction to Lombok

May 15, 2019 · Brian Hannaway

I understand why people use Lombok, but for me it's the reason why I don't use groovy and other magic languages ... I want to see the code, I want to see that getter is not used and I can remove it, and so on ... to write 2 lines less does not mean that the code is more readible because of annotations ... great example is Spring Boot. Does anyone exactly know what all the annotations mean? And what is exactly autoconfigured during the startup? To have 2 less lines in source file does not mean cleaner code :)

User has been successfully modified

Failed to modify user

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook