News for hackers. Stuff that matters.
Re:A Closer Look at Android RunTime in Android L by rtpg on Monday November 10, 2014 @03:19AM (#8582513)
betweeen having GC pauses and having memory leak continuously (and buffer overflow issues which become security issues) I'll take GC pauses.

Time has proven again and again that humans are really bad at memory management and having raw access to memory is something that needs to be justified on a case by case basis.

Re:A Closer Look at Android RunTime in Android L by swartkrans on Monday November 10, 2014 @03:23AM (#8582521)
> Time has proven again and again that humans are really bad at memory management

Well until AI write garbage collectors I'm not sure I see how your comment doesn't also apply to them. And lots of great software manages memory quite fine, like that browser you used to write your comment and the operating system it runs on, so not sure the use of "proven" is appropriate in your comment.

Re:A Closer Look at Android RunTime in Android L by pjmlp on Monday November 10, 2014 @04:21AM (#8582660)
Really?! Mozilla even has a memory leaks tooling tracking page:

https://developer.mozilla.org/en-US/docs/Mozilla/Performance

And are making Servo in Rust, which uses compiler dataflows form memory management.

Apple has added ARC to Objective-C and Swift.

Microsoft uses GC in .NET, ARC in C++/CX.

Modern C++ favors RC.

They all seem to think manual memory management is to be avoided.

Re:A Closer Look at Android RunTime in Android L by pcwalton on Monday November 10, 2014 @05:16AM (#8582782)
Rust shows that "between having GC pauses and having memory leak continuously (and buffer overflow issues which become security issues) I'll take GC pauses" is a false dichotomy, however.
Re:A Closer Look at Android RunTime in Android L by ZeroGravitas on Monday November 10, 2014 @06:32AM (#8582994)
Rust is one of the coolest things in programming at the moment, but if you have to invent your own programming language to cut this gordian knot, then it's not really a false dichotomy for most practical purposes. And it'll stay a genuine dichomoty until Rust (or something like it) is a mainstream choice.
Re:A Closer Look at Android RunTime in Android L by rtpg on Monday November 10, 2014 @07:00AM (#8583069)
I'm glad for the advances in Rust. My comment was meant in the context of the current state of the art (Java/C++ like). If we move forward enough the GC questions could be a thing of the past.
Re:A Closer Look at Android RunTime in Android L by pjmlp on Monday November 10, 2014 @05:32AM (#8582834)
Yes, I am following it quite closely.

However it does place a bit of cognitive burden, but last version already improved it.

Re:A Closer Look at Android RunTime in Android L by dbaupp on Monday November 10, 2014 @07:23AM (#8583135)
> Modern C++ favors RC.

Does it? I was under the impression that the order of preference (from most preferred to least) is something like:

  - plain values (i.e. no pointers)
  - references
  - unique_ptr
  - shared_ptr
  - raw pointers
Re:A Closer Look at Android RunTime in Android L by pjmlp on Monday November 10, 2014 @07:52AM (#8583233)
Raw pointers is the last item on your list after RC pointers.
Re:A Closer Look at Android RunTime in Android L by dbaupp on Monday November 10, 2014 @08:33AM (#8583373)
From this response, I guess that maybe you were meaning C++ favours RC compared to manual memory management, and were not saying that it is the globally preferred option, but this differs to everything else in your list: the others are the main/preferred strategy in those languages/libraries.
Re:A Closer Look at Android RunTime in Android L by pjmlp on Monday November 10, 2014 @10:25AM (#8583984)
> I guess that maybe you were meaning C++ favours RC compared to manual memory management,

Yes.

> the others are the main/preferred strategy in those languages/libraries.

While true, manual memory management is still possible, but should be left for the 1% cases that really benefit from it.

Re:A Closer Look at Android RunTime in Android L by rtpg on Monday November 10, 2014 @03:34AM (#8582541)
I think we've all used software that suffers from some pretty intense memory leaks ( including older versions of firefox!), and garbage collectors can be "good enough" for a huge amount of applications.

Most applications are _not_ games or web browsers, but enterprise-y CRUD applications.

I'm fine with having the ability to turn that off for specific things, but it should be made as inconvenient as possible to avoid the "Can't have GC pauses in my todo list" usecase.

Re:A Closer Look at Android RunTime in Android L by taspeotis on Monday November 10, 2014 @03:33AM (#8582538)
> And lots of great software manages memory quite fine, like that browser you used to write your comment

Which bit of the browser are you talking about? Garbage collection is used extensively during the execution of JavaScript in a lot of browsers. For example, Chrome [1].

[1] https://developer.chrome.com/devtools/docs/javascript-memory...

Re:A Closer Look at Android RunTime in Android L by baddox on Monday November 10, 2014 @04:58AM (#8582735)
Presumably the humans writing popular garbage collectors are significantly better at memory management than the average programmer. You wouldn't say that humans shouldn't go to doctors until there are AI doctors.