Live data from Hacker News

Java’s new garbage collector promises low pause times on multi-terabyte heaps

opsian.com

171–180 of 245 posts

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#171
post #79
post #76

Earlier quoted context omitted.

Can you please elaborate?

It's just an object that lives on the stack, not the heap. In lots of languages when you create an object, it's pretty explicit where you're putting it. When Java was created, they wanted to get rid of that complexity, so primitives always go on the stack and objects always* go on the heap. * I think Java has escape analysis, which means that if it can determine that an object you created doesn't leave its context, i…

When Java was created, they wanted to get rid of that complexity, so primitives always go on the stack and objects always go on the heap.*

This was inherited from Smalltalk. Everything was an "object reference," with tag bits and all, but SmallInteger was optimized by using the low 16 bits of the object reference pointer to store the SmallInteger. So you can think of Smalltalk as having SmallInteger as a "primitive" type with pass by value.

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#172
post #79

Earlier quoted context omitted.

It's just an object that lives on the stack, not the heap. In lots of languages when you create an object, it's pretty explicit where you're putting it. When Java was created, they wanted to get rid of that complexity, so primitives always go on the stack and objects always* go on the heap. * I think Java has escape analysis, which means that if it can determine that an object you created doesn't leave its context, i…

You mention it in your footnote, but objects don't necessarily live on the heap - they can also live on the stack, or in registers, or in vector pipelines, or not at all. Also an interesting aside is that objects are never 'allocated on the stack'. As in you won't find the same layout of memory on the stack as you do on the heap. Instead objects are turned into data edges in the compiler's graph. It's much more abstr…

For further details on how objects are not exactly allocated on the stack: https://shipilev.net/jvm-anatomy-park/18-scalar-replacement/

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#173
post #141

Earlier quoted context omitted.

Why?

Basically oracle is attempting a hostile takeover of java. I'm keeping everything I do openjdk8 to avoid potential legal action.

That’s not much of an answer. If anything, it seems to me like Oracle is seeding more control to the community. I could be wrong though, I don’t follow this stuff as close as some.

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#174

Earlier quoted context omitted.

Hrm, I would think that if you were developing a game in a GC environment, where GC timing turned out to be a problem, you would get rid of dynamic memory allocation, and try to do everything much more like embedded system programming with fixed memory blocks...? I suppose at the complexity of modern games that's simply not possible anymore...

You can do that, and people do. However a GC language doesn't normally give you the flexibility of getting a block of memory and doing whatever you want inside it, instead you use things like object pools.

I consider object pools to be well within that family of problem solving that I'm talking about.

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#175
post #169

Earlier quoted context omitted.

Basically oracle is attempting a hostile takeover of java. I'm keeping everything I do openjdk8 to avoid potential legal action.

You know that the majority of OpenJDK developers are Oracle employees, right?

I didn't know that. However, doesn't change my stance. Why would I upgrade to java 9 or 10 when I am at the mercy of oracle's lawyers?

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#176

Earlier quoted context omitted.

Basically oracle is attempting a hostile takeover of java. I'm keeping everything I do openjdk8 to avoid potential legal action.

That’s not much of an answer. If anything, it seems to me like Oracle is seeding more control to the community. I could be wrong though, I don’t follow this stuff as close as some.

Coming sometime this winter they will require a license to use java 9 and up.

Below is a link for the downvoters and skeptics:

https://www.aspera.com/en/blog/oracle-will-charge-for-java-s...

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#177

Earlier quoted context omitted.

> It's just an object that lives on the stack, not the heap. That's not quite correct. A reference type might contain a value type field, in which case the value type will still live on the heap. Conversely, a local variable's type might be a value type, and _still_ involve a heap allocation. For example, std::vector in C++ is a value type but the array storage is heap-allocated. So it's really about semantics, and n…

> For example, std::vector in C++ is a value type but the array storage is heap-allocated. This isn't correct. Firstly, C++ doesn't have value or reference types. Where any object is stored depends purely on how it is allocated. Either in the free store (dynamic) or automatic storage (the stack). std::vector has a constant object size - typically the size of 3 pointers (but that depends on the implementation - the st…

The parent is correct. std::vector is a value type in the sense that everyone else is talking about... All types in C++ are, as their members are not inherently stored on the heap. C++ (and C, and Rust) has types that behave like what other languages call value types, even if there is not any other sort of type.

The mention of array in the parent was referring to the dynamic storage of a vector, not std::array.

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#178

Earlier quoted context omitted.

That’s not much of an answer. If anything, it seems to me like Oracle is seeding more control to the community. I could be wrong though, I don’t follow this stuff as close as some.

Coming sometime this winter they will require a license to use java 9 and up. Below is a link for the downvoters and skeptics: https://www.aspera.com/en/blog/oracle-will-charge-for-java-s...

Oh dear - the FUD is strong with this one. You’re only required to buy a commercial license if you use Oracle’s JDK beyond their free public updates timeframe and if you want the subsequent security patches etc from Oracle. There are also a whole bunch of $free (and $commercial) OpenJDK alternatives by Azul, RedHat, IBM, AdoptOpenJDK, distrust etc.

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#179
post #166

Earlier quoted context omitted.

You can do that, and people do. However a GC language doesn't normally give you the flexibility of getting a block of memory and doing whatever you want inside it, instead you use things like object pools.

System.Runtime.InteropServices.Marshal in C#'s case.

Also `fixed` in C# [1]

Not used Span and Memory [2] in anger yet, but they also seem to be attacking the issue from the other end

[1] https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...

[2] https://blogs.msdn.microsoft.com/mazhou/2018/03/25/c-7-serie...

Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps

#180

Earlier quoted context omitted.

Coming sometime this winter they will require a license to use java 9 and up. Below is a link for the downvoters and skeptics: https://www.aspera.com/en/blog/oracle-will-charge-for-java-s...

Oh dear - the FUD is strong with this one. You’re only required to buy a commercial license if you use Oracle’s JDK beyond their free public updates timeframe and if you want the subsequent security patches etc from Oracle. There are also a whole bunch of $free (and $commercial) OpenJDK alternatives by Azul, RedHat, IBM, AdoptOpenJDK, distrust etc.

What does FUD mean in this context?

edit: I looked it up.

Your comment is obviously correct and valid. However, my stance is unchanged. I will stick to openjdk8 and avoid oracle regulatory influence.

Post reply on HN