Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. This post was edited and submitted for review 1 year ago and failed to reopen the post: Original close reason(s) were not resolved
Tag: performance
What does “Other” mean in Java GC log?
I have such setup Java 11 Corretto inside Docker running on EC2 Java options: -Xms1200m -Xmx1200m -XX:+UseG1GC -Xlog:gc* In log I see that usually GC takes ~100-200ms, but for some timeslots, I see some weird behavior: [2074.114s][info][gc,phases ] GC(39) Other: 4082.5ms What does this “other” step mean? Answer This is most likely due to time spent writing the log out
In Java, how to copy data from String to char[]/byte[] efficiently?
I need to copy many big and different String strs’ content to a static char array and use the array frequently in a efficiency-demanding job, thus it’s important to avoid allocating too much new space. For the reason above, str.toCharArray() was banned, since it allocates space for every String. As we all know, charAt(i) is more slowly and more complex
short -> int -> long type promotion: is there any overhead?
If, for example, I define method’s return type/parameter as char, but both the caller and implementation actually immediately use it as an int, is there any overhead? If I understand correctly, the values on the stack are 32-bits aligned anyway, as are the ‘registers’ (I’m sorry, I’m not well versed in the byte code). A word of explanation: I am
Profiling Java code changes execution times
I’m trying to optimize my code, but it’s giving me problems. I’ve got this list of objects: There is 1700 objects with unique id (0-1699) and some name, it’s used to decode what type of data I get later on. The method that I try to optimize works like that: This method is called about milion times when processing data
Sandboxed java scripting replacement for Nashorn
I’ve been using Nashorn for awk-like bulk data processing. The idea is, that there’s a lot of incoming data, coming row by row, one by another. And each row consists of named fields. These data are processed by user-defined scripts stored somewhere externally and editable by users. Scripts are simple, like if( c>10) a=b+3, where a, b and c are
Passing data from a Pop up back to its Parent
The parent class activity consists of adapters and recycler views. Using one of the adapters the one click is set for images. If an image is clicked it opens a pop-up and the pop have some sliders and text fields. And the pop-up will collect data from users. Now I need this data, not in the adapter class but I
Presto cluster + how to tune the jvm.config according to memory resources
we are using presto cluster as distributed SQL query our cluster size 1 machine as coordinator machine 12 presto workers machines each machine is 64G memory size , and on each machine only presto application installed about the jvm.config on the workers , look like this and the jvm.config on the presto coordinator , like like this we set the
Count the semiprime numbers in the given range [a..b]
I am solving Codility problem CountSemiprimes: Count the semiprime numbers in the given range [a..b]. Task description A prime is a positive integer X that has exactly two distinct divisors: 1 and X. The first few prime integers are 2, 3, 5, 7, 11 and 13. A semiprime is a natural number that is the product of two (not necessarily
Garbage Collector not freeing “trash memory” as it should in an Android application
Hello! I’m a beginner Java and Android developer and I’ve been having trouble lately dealing with my app’s memory management. I will break this text into sections, in order to make it clearer and readable. A brief description of my app It’s a game that consists of several stages (levels). Each stage has a starting point for the player and