📜 ⬆️ ⬇️

What is silent Joker. The story-story about the conference

On October 15, the glorious city of St. Petersburg was visited by the super villain of the Joker Universe.
No, he did not kill anyone, and not a single Batman was hurt. But his visit, however, will be remembered by many. First, it was the premiere of a new Java technology conference. Secondly, this conference was a success, and this means that a great future awaits it, and the first conference is always a story.

image

A pleasant surprise


I spoke at the conference as a speaker: the organizers appealed to me two months before and offered to speak, which was a pleasant surprise. It was organized by the leaders of the St. Petersburg JUG - Alexey Fedorov (@ 23derevo), Andrey Dmitriev (@real_ales) and Ivan Dolgov (@jetliner) (and many more who helped). At one of the afterparty, Alexei told how the idea of ​​the name of the conference came to him: “I listened,” he said, “in Mariinok, Love for Three Oranges,” Prokofiev, and then could not sleep for a long time. Her head spun different characters: the king of spades, the king of clubs, the jester. And the deadline for the concept of a new conference was already on the nose. So the idea arose to somehow beat the topic with playing cards. Well, since Java conferences are usually called something like the letter J, the word Joker came somehow by itself. ”

And all the more surprising that in two months the guys managed to make a very decent program, working with all the speakers individually, doing the runs and helping in every way. But the program did not go without curiosities: the three titles of the reports began with “What is silent ...”.
As it happened, this story is silent.
')

Accommodation


From our company Excelsior , two people spoke at the conference: me and Pavel Pavlov (@noinline). The conference was held on Vasilyevsky Island, in the hotel “Baltic”. Coming out of the subway, we decided to walk to the hotel - it seemed to us a good idea to walk around the night Peter. But after passing about 10 meters, we suddenly found ourselves in the city of Novosibirsk: painfully familiar Soviet buildings and the weather is exactly like in Novosibirsk. “3rd Street Builders", in short.

Almost all visiting speakers and organizers lived in the same hotel, and since the conference was also held at the hotel, it was possible to go for reports in slippers. And it was some kind of miracle, for the first time I ran into this: wake up in the morning, go to breakfast, meet a bunch of familiar people, hang out until you start expelling for lunch, then you go upstairs to the second floor - and here’s a conference and then you go back to the hotel, and then there is afteaftepati. In short, I talked to programmer topics like never before in my life, I even got tired of it at the end of death!

The conference


And rising to the second floor, I was at the conference. When I met the organizers with swollen eyes, I immediately understood who today are the “heroes of our time": one could guess without question that the team had barely slept the last few days.
The opening of the conference remained almost unnoticed, Lyosha Fedorov told where there are any halls (marked with card suits - the same style must be maintained), which everyone went to. In the corridor it was possible to take pictures with the Joker (see photo above) and play ancient computer games.



“How I created a Java desktop application, downloaded 9,000,000 times”


I went to the report of Anton Keks (@antonkeks), the author of the sensational report on JUG.ru “ How to save Java .” Anton is engaged in the main work with a “bloody enterprise” (a term that I picked up at this conference), and in my free time makes the popular desktop application for wiretapping the grid “Angry IP scan”, which Anton originally wrote in C, and then rewrote in Java, for which he is very pleased.



The report began with a small facac: all the reports came from the computers of the organizers and there was no Java on these computers! As a result, Anton could not show his application in action. This fact once again convinced me that if you are doing desktop applications in Java, you cannot rely on what the end user has this Java (about how to solve this problem, my report “Java loses weight” on JavaOne in Moscow ). But, unfortunately, this did not convince Anton.

The whole report, Anton tried to convey to people a simple idea of ​​what to do in Java desktop applications can and should be! With which I fully agree, I still sincerely surprised by the fact that Java on the desktop is not very popular, especially with the growing popularity of Mac and Ubuntu. The latter fact pushed Anton to rewrite the application from C and Win API to Java, simply because he himself hasn’t been using Windows for a long time, but he doesn’t feel like losing Windows users.

As a Java UI, Anton promoted SWT. If anyone knows, this is IBM's UI library on the basis of which Eclipse's UI is made. The trick of this library is that applications written in SWT always look like native applications of the target platform, simply because they use native controls for drawing the UI. What is wrong with the default UI for Java is Swing, where the target platform UI is emulated (and not always well). Generally war Swing vs. SWT were satisfied with the popularity of the early 2000s. My personal position on this is that both UIs are good, and if you always get the native UI of the target platform on SWT, then on Swing you can make the UI better than the native one and an example of this IntelliJ IDEA (I don’t think that Windows is well draws buttons, windows). And in light of the last statement, I also do not consider the choice of JavaFX to be bad.

Anton also spoke about HIG - human interface guidelines. The idea of ​​this thing is that different platforms have their own rules for nesting / naming controls, and it is better to follow these rules so that the end user gets the familiar experience when working with your application. And so the HIG rules of a particular platform need to be considered when writing a UI. Yes, there will be a bit of platform dependent code, but with different tricks (such as a layout manager), as Anton claims, the amount of this code can be made very small.

After the report, Anton and I talked for another 20 minutes in the corridor: I am very pleased to meet him, and he is probably one of the highlights of this conference for me.

Project Jigsaw. New fail


During the coffee break, I met Shur Ilyin (@shurymury) - he gave a talk at this conference on “Project Jigsaw. Take 2 ”. I was very pleased to meet him and asked him in a friendly way: “Well, is he ready for the report?”. To which he was stunned by me: “Of course I am, because my entire report will carry one simple thought: PFC! ". I say: “I do not understand what PFC means? ". Shura:" And that means that there will be no Jigsaw, PFC! More precisely, there will not be a public Java modular system. " , to make this report, and he declares there that we decided not to release the modular system, because nobody needs it and asks the hall “does anyone need a modular system here?” ... and a full room of hands! ”. As a result , as they said later, Shura put his entire report in 15 minutes, which disappointed many, but believe me, he is as disappointed ! As I.

One can only guess what happened this time with the project, but I hope that the Java community will not leave it just like that and we will still have a standard modular system in Java.

Understanding the garbage collection process and what you can do about it


Then I went to the hour and a half report of the CTO and Co-founder Azul Systems - Gil Tene. It was a great report - highly recommended. If anyone does not know, Azul has started with the production of its multiprocessor Vega computers, where each processor with 54 cores on board and a terabyte of RAM can be plugged into such a machine. And for these computers, they made a specialized JVM: they had to solve the problem of scaling their JVM on a huge number of processors and memory. After learning how to make a GC that can scale to huge amounts of memory, Azul decided to give happiness to everyone and released a JVM called Azul Zing. This JVM is inherited from HotSpot (there are only MM and GC), so it works on the same hardware as HotSpot.

Gil spoke in great detail about the garbage collection in Java, starting with the basics and ending with the most sophisticated technicians, refreshing in my memory everything that I knew about GC. What served me well, because in a couple of days I also had to tell JUG about GC already in our JVM - Excelsior JET . By the way, I was very struck by how Azul GC looks like ours, at least superficially: it is assembled from the same bricks, but we came to this independently.



The basic idea that Gil tried to convey was that the garbage collection process had not yet reached a full stop, and the GC set that HotSpot has is far from ideal. As a result, a regular Java developer needs to know a million pens to tweak the GC in order to solve their memory management problems in Java. In his opinion, the pen should be exactly one: –Xmx (we went even further, and in our GC even this pen is not needed ). And instead of hiding your head in the sand and saying that in Java there are no problems with memory management, you can try to look at the Java world more broadly and find that there are other JVM implementations in which your memory management problems may be better solved.

It seems to me that this was the strongest report at the conference, so it is extremely surprising that he did not make it to the top 10 reports as estimated by the viewers, despite the fact that the report about the field layout in HotSpot objects got into this top. It seems that people are very wary of alternative implementations of Java. But why? After all, it is a great happiness that Java allows you to make alternative implementations and at the same time ensures that your application will work on any implementation compatible with Java. And these implementations can solve problems that Oracle will never reach.

After the report, I managed to talk with Gil: we talked about our GC. I was pleasantly surprised that he knows about us perfectly. In general, developers of any JVM in the world, as a rule, know about us, which, unfortunately, cannot be said about Java developers.

Entertaining stories from the life of JVM technical support


After lunch (very good, by the way), it was my turn to speak to me: we made a joint report with Misha Bykov from Oracle. The idea of ​​the report was born in January. The time of passing the conference successfully coincided with the time of the holiday of Misha, who he decided to spend in Europe and Russia (he himself lives in the USA). Misha works at Oracle Java Licensee Engineering and some time ago was our official dedicated technical support engineer from Oracle, really helping us pass JCK tests. In addition, he is engaged in technical support for large Oracle customers. We also have technical support in Excelsior, and all the JVM developers, including me, are on duty in turn. Over the years, Misha and I have accumulated quite a lot of interesting and amusing cases from the life of technical support, and we decided to share them with the world. We broke the report into four parts of the most frequent and typical problems of technical support and diluted them with funny stories. We wanted to make the report entertaining, and I think we did it: it was fun, people laughed.



Scala for professionals


From our company there was also a report about Scala, which was done by Pasha Pavlov.

A few years ago, we decided to rewrite the core of our JVM almost completely. One of the essential components of our JVM, which distinguishes it from other JVMs, is the AOT compiler, that is, the compiler that generates optimized machine code before the program is executed (“honest exe” is obtained). AOT compiler we decided to rewrite to Scala, and you know, we did it! Therefore, we initially wanted to make a report “Java in Scala” (as opposed to Java in Java of the fairly well-known Graal project from Oracle Labs - an attempt to rewrite HotSpot JIT in Java), in which we wanted to describe our experience of using Scala in such a rather complicated project. But on the voting here, in Habré, the report was not so popular, and the organizers asked to change the topic to a more general, but about Scala. As a result, Pasha was only 2.5 weeks to prepare a report. And he cooked it right up to the performance! He managed to do the only run at the airport among the announcements “Passenger Ivanov, go straight to the landing.” Of course, this all affected the performance, but I am pleased that Pasha still conveyed to people his main idea that Scala is not just the best Jav, and an independent language with its own ideology and with a great future. In the middle of the report, a funny episode occurred: at the moment when Pasha called lambdas in Java 8 a “cheap Chinese imitation”, Lyosha Shipilev (@TheShade) sent this tweet:



I bet your application has a memory leak?


When this report appeared on the vote on Habré and suddenly became the leader, many were surprised by its topic: how is it that Java has garbage collection, and thus memory leaks are basically impossible. But this topic did not surprise me at all: I have seen so many of these leaks in my life using the example of our clients!

The garbage collector collects only those objects that are inaccessible through the global (static) class fields and from the stack of called methods. And if you have a global hash-type field, start adding objects there (for caching, for example) and forget about clearing this hash table, as you will immediately have a memory leak.

Many popular Java frameworks have internal caches (which are often arranged as hash tables) and, without knowing it, you can get a memory leak out of the blue. The report of Nikita Salnikov-Ternovsky was precisely the fact that if you forget to pull this in such a framework, you will get a leak (how you should know this is not clear).

Particularly interesting was the case with ThreadLocal. Nikita argued that if you start a global ThreadLocal type in your web application, and then redo this web application (without restarting the server), then you are guaranteed to get a leak. This case, we then dismantled in detail after the aftepati with Lesha Shipilev and found that there is a bug in the implementation of the ThreadLocal in the Java API! Then we felt for a way to treat it, and Lesch promised to report this bug.

What are Heap Dumps silent about?


I heard the idea of ​​this report from Lesha Shipilev at JavaOne in Moscow. He said that he was tired of reading various posts on Habré about how to correctly lay out the fields in his Java objects, and that he wants to make a report on how the fields lay out HotSpot. In principle, any Java implementation optimizes the layout of fields in an object for reasons of alignment, processor cache behavior, and minimization of object size. Therefore, the order of the fields that you specify in your classes does not mean anything at all: for a JVM, it's just a set of fields that she is free to arrange, as she pleases (on different JVMs, and even on different versions of the same JVM, this order may be different). Therefore, there is nothing more stupid in Java programming, how to try to optimize something in the order of fields at the source level. But then in Moscow I was surprised that from the fact that I told you here in two sentences, you can make a whole report. But Lyosha managed (not without the help of Baruch (@jbaruch), however, who kept the microphone at the end of the report, when Lyosha died with his hands free microphone)!



At the end, the reaction of the listeners who amused me was amused: “imagine, they may not have such facilities in the field facilities!” And once again I was surprised why people are so eager to go and listen to reports on the specific insides of the JVM.

Afterparty


The conference had two after-parties, one informal, which was at the end of the first day, and the official: after unconference. On the first day, developers of different JVMs were located in one corner, in the other - Java EE wizards. And in the middle was Shura Ilyin, who screamed in the midst of the party: “well, here is JVM hardcore, there is bloody Enterprise, and what am I doing here!”.

Since the afterparty was on the other bank of the Neva, it was necessary for those who lived in the hotel to have time to get there before the separation of the bridges. All this was done in different ways. I left quite early, someone got on the “three-hour” information, and some didn’t have time for it, and as a result walked around Peter until six in the morning and returned to the hotel in the morning. Therefore, the next day at the Unconference some people could not attend.

Unconference


What is Unconference did not know anyone who was going there. On the eve, all the speakers were given two invitations to the event: one for themselves and the second speaker could give any listener of the first day. And of course, most speakers forgot about this invitation, I, however, at the end of the first day remembered and handed over to someone.

At the beginning of Unconference, Sasha Belokrylov (@alexbel) announced the format: the event is divided into three semantic parts: round tables, where some topics are discussed - they are declared by anyone who wishes and which topics the participants will vote for more, those topics are discussed; lightning talks - 5 minute reports on any topic; “Stuffing from the audience” - you can throw a piece of paper with any question into the ballot box and then answer the whole crowd with these questions.



Initially, without knowing the exact format of the event, I thought to speak with the theme “Web 3.0” , which I announced last year at DevDay in Novosibirsk. This report on the format does not fit into any conference, and I thought that for Unconference it would be just right. But to my surprise, the report did not fit the declared format: the report lasts a little more than 5 minutes. I asked the audience to give me 20 minutes: there was a beginning, few people understood what was happening and everyone agreed. So to say, allowed to warm up.

In short, the idea that I voiced is as follows. I want to add to the Java platform another application distribution model, in which the application comes from the network in parts and on request, and the first comes from the network view (user interface). That is, I want to arrange distribution of client Java applications by the type of Web applications. But this is not Java WebStart (and not applets), where the application is downloaded entirely from the network. In my model, applications will arrive on the client instantly, as on the web, and can be arbitrarily complex, like on a desktop. And, which is also important, you can write such applications in any JVM languages, from JavaScript to Scala.

In principle, this technology can compete with the classic web based on HTML + JavaScript. It includes the classic web, while giving the programmer opportunities that the web in its current state is not capable of giving and it is not clear when it will be able to. Therefore, I positioned it as Web 3.0. But on Joker, I finally realized that it is more correct to position this technology as Desktop 2.0, because web developers accept this idea with hostility and should never sell it to me.

After me, Gil Tene spoke, who complained that I spoke Russian. He once again reminded that Java has a lot of problems in the garbage collection, which are actually challenges and that you don’t need to hide your head in the sand, but you have to solve problems.

Then there was a pack of reports, of which I did not remember much. And before dinner, we dismantled "stuffing from the hall." From remembered: “Does Java have technical support?”, “Java turns into C ++?”, “How can I fix a fix in OpenJDK?”, “Do I need as many tests in Java as for dynamic languages?”, “Can I does static analysis catch mistakes?

After lunch we were going to mugs. I stated the topic “The Future of Java in RIA and Mobile”, which successfully gained the required number of votes. But, unfortunately, the discussion turned into a flame: Victor Polishchuk took part in it, one of the conference speakers, who defended the view that the Web is very good today for writing client applications, moreover, it is developing rapidly, and that Java in client- side is simply not needed. I defended the exact opposite point of view: the complexity of tasks on the web is growing rapidly (on the client side), and that after a while the current technologies based on HTML + JavaScript will solve these tasks too expensive, because web technologies have problems built from birth which are not solved naturally. Then Sasha Belokrylov joined the discussion, who said that, starting from a certain barrier of complexity, it would be inappropriate to write applications on the web, but it would be more correct to do them in the desktop (rather than supporting my point of view without knowing it) and to have WORA (write once run anywhere), you need to write them in Java. But Vitya stubbornly disagreed with this and to the question “Can I write Photoshop in web technologies so that it still works comfortably and quickly?”, Without hesitation, replied - “You can!”.

We also discussed mobile. I shared the pain of many mobile developers: having written an application for one mobile platform, on the other I had to practically rewrite it. In the end, everyone has fun as they can: someone writes in C, someone has fun with JavaScript. And my opinion is that Java is here to come to the rescue by providing a higher level (compared to C) and good performance (compared to JavaScript). The participants expressed doubt that Java could appear on iOS, because there is no JIT (iOS policy) possible. I talked about Excelsior JET, which can statically compile Java into native code, while remaining compatible with Java, and that we have plans to make an iOS solution. What surprised the audience: about us, even the speakers, as it turned out, rarely know.

I also took part in the discussion about OpenJDK. They discussed topics that it’s extremely difficult for a mere mortal to commit to something in OpenJDK and that Oracle engineers have an obvious advantage here. I, in turn, complained that we had found and fixed quite a few bugs in the Java platform in our implementation and that we would gladly donate these fixes to OpenJDK, but then we might have licensing problems: our code will be released under the GNU license and it is not obvious whether we can use our own code in our commercial license for Java.

Aftepati 2


The second afterparty was not far from the hotel, respectively, this time the people living in the hotel had no problems with building bridges. We, the JVM boxers, got bored again, which, however, made Kirk Pepperdine depressed this time: it was extremely difficult for us to discuss the problems of the JVM in English (there was not enough vocabulary) and we discussed them in Russian.



After the aftepati, the afteaftepati happened with Viktor Polishchuk in the hotel. We grappled with languages ​​on the subject of Java vs. Javascript My opinion here is that writing large systems in JavaScript is not environmentally friendly: this language was created for another purpose. In addition, knowing that the virtual execution environments are not hearsay (after all, 16 years of JVM manufacturing experience), I can imagine what the hell it is to optimize JavaScript in the almost total absence of typical information. But in the end, Vita managed to convince me that by observing some disciplines of programming in JavaScript (for example, using JSDoc and tools that check static constraints on input parameters, by the way, does anyone use them?), You can write large JavaScript systems. I, in turn, managed to convince Vitya that JavaScript has performance problems. At the end of this conversation, I had the desire to write a total Java vs. article. JavaScript: people have an obvious misunderstanding of the nature of these phenomena. But I will write it for a long time.

JUG: Excelsior JET in action


The next day, despite the fact that the Joker conference officially ended, it did not end for Pasha Pavlov and me. On this day, we performed with him at the St. Petersburg JUG and talked about Excelsior JET. At the St. Petersburg JUG I was invited to speak at JavaOne in Moscow. We previously agreed on autumn, but in the fall JUG decided to hold a Joker. But in order, as they say, not to get up two times, we decided to speak at JUG too.



But we were preparing for the conference, and therefore we did not have the physical ability to prepare for a speech at the JUG. As a result, we, as true professionals, completed the slides in the minibus on the way to the Oracle office where the meeting took place. Arriving at the office, it turned out that the organizers did not expect that we were going to report from our laptop: we really were going to show Excelsior JET in action, and did not want to put it on the organizers' laptop. But they needed to arrange a video capture of the laptop screen, and for this they needed a special program that, unfortunately, required .NET 4.0. It turned out that this miracle in feathers weighs more than 200 megabytes and is set for a very long time. Because of this, the beginning of the report moved away, and Lyosha Shipilev came to the rescue, who said that video capture can make VLC - and she does not need .NET. We quickly installed VLC and started the report. And the vaunted .NET was then set for almost another hour and did not allow itself to be killed, which interfered with the presentation in some places. Why have I been telling this for so long: whoever will watch the video may not understand the joke about .NET without this context.

Excelsior JET, JVM : , Java. .

, , 3.5 , , ! , , . -: . SSA Regalloc, 2005 ( „ “), , . , ! , .

JCK


– , ! Oracl JCK .
. JCK, JCK. , Oracle ! , IBM, HP, SAP, .


. - ! - - .



, , !

Source: https://habr.com/ru/post/202804/


All Articles