Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Toady
Jan 12, 2009

Tiny Bug Child posted:

the year is 2012 you don't need to worry about memory except in a couple of edge cases

- web "developers"

Adbot
ADBOT LOVES YOU

Nomnom Cookie
Aug 30, 2009



Shaggar posted:

yeah but dont you gotta worry about heap fragmentation if ur creating and destroying tons of stuff? idk. i've never run into it as an irl problem nor have i had gc pausing create performance issues.
With a GC like CMS heap fragmentation means eventually you'll have to do a stop-the-world collection on the old generation because CMS doesn't do concurrent compaction. G1GC tries to avoid that by organizing the heap differently and compacting smaller chunks during separate pauses. This isn't a problem unless you have tens of GBs of live objects and an old gen collection will take minutes or you have a few GB and are trying to do soft real-time and can't have collections take longer than 100ms or whatever.

And Azul is like "our JVM brings all the boys to the yard, and they're like, it's better than yours" but you can only play with it under a sales engineer's supervision so I wonder what they're hiding. Probably terrible throughput.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

rotor posted:

i remember some of the most fun i had writing porgrams was for the palmpilot where your binary had to be like <20k or people made fun of you

we had a competition at the university where we had to make signal generator on a 8052 chip, with a user-selectable frequency from 10 Hz to 10 kHz range and 10 Hz step size. the entries were ordered by binary size. i wrote the loving thing in 100% assembler and finished 2nd.

... if only i had remembered that a division is just subtraction, and written the function myslef instead of using that math library :smith:

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Nomnom Cookie posted:

And Azul is like "our JVM brings all the boys to the yard, and they're like, it's better than yours" but you can only play with it under a sales engineer's supervision so I wonder what they're hiding. Probably terrible throughput.

Yeah, this was the problem with Jikes and other similar schemes iirc. "We can guarantee* a pause will never take more than 100ms and that we can never have a fraction of cpu time given to the mutator of less that .4, which sounds much better than saying that gc can eat 60% of your time budget in exchange for soft real time performance that's a couple orders of magnitude too slow for anyone to care"

Shaggar
Apr 26, 2006
Use HotSpot Or JRockit

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
erlang gc owns, it's per-erlang-process (green thread) since they don't share anything so if you have a short-lived process it doesn't need gc and if you have a long-lived one it's probably not doin' much all the time anyways so can get gc'd when it's not busy

salted hash browns
Mar 26, 2007
ykrop
garbage collection owns
java owns
memory management is for chumps

code:
free(yourpost);

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
if i was actually doing fft or math stuff on ios i'd probably use apple's Accelerate framework

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

salted hash browns posted:

garbage collection owns
java owns
memory management is for chumps

code:
free(yourpost);

i like automatic reference counting because you don't get gnarly sawtooth memory usage patterns

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
gnarly is an underused word

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
i use surfer lingo to describe programming concepts

multigl
Nov 22, 2005

"Who's cool and has two thumbs? This guy!"
gnarly ? i barely gnu her.

Sneaking Mission
Nov 11, 2008

tubular

salted hash browns
Mar 26, 2007
ykrop

vapid cutlery posted:

i like automatic reference counting because you don't get gnarly sawtooth memory usage patterns

can you expand on this, i'm not very familiar with arc

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

salted hash browns posted:

can you expand on this, i'm not very familiar with arc

originally objective-c on the mac/ios platforms required manual reference counting. ie when you want to take ownership of an object/keep it around you have to call retain on it. there were a whole bunch of shortcuts added with properties and autorelease to make it a lot easier but you basically ended up manually managing memory. then when they switched to the clang/llvm compiler toolchain they started using static analysis that could point out when you missed a release or retain. then the next logical step was to make the compiler insert them for you, and THus born out of the womb of stevephn jobs was automatic reference counting

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
here's a diagram

ChiralCondensate
Nov 13, 2007

what is that man doing to his colour palette?
Grimey Drawer

vapid cutlery posted:

here's a diagram


thank u for the needful

Shaggar
Apr 26, 2006

vapid cutlery posted:

here's a diagram



do you have to tell it when to do things/give it hints or is it all totally automatic?

Maximo Roboto
Feb 4, 2012

There are cases where you need Weak references instead of Strong references, but usually when you create instance variables you just declare them as Strong. It's not 100% automatic.

it's not actually garbage collection, but the developer does minimal work because of it so it's sort of like GC.

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
it's about 99% automatic

Shaggar
Apr 26, 2006
thats cool. are there any real downsides (aside from the edge cases)?

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Shaggar posted:

thats cool. are there any real downsides (aside from the edge cases)?

not really, it's pretty amazing. i mean there's obviously the downside that it's on a pretty niche platform

Shaggar
Apr 26, 2006
it would seem like that would be a pretty popular feature for like a c#/java. maybe do that for strong references or w/e and let the gc handle the weak ones for u? ultimate combined lazyness+performance

double sulk
Jul 2, 2010

shaggar's transformation to the dark (objc) side begins :gay:

Shaggar
Apr 26, 2006
lol no. its mac only so theres no reason to ever use it. im more interested in arc than obj-c anyways

Maximo Roboto
Feb 4, 2012

vapid cutlery posted:

not really, it's pretty amazing. i mean there's obviously the downside that it's on a pretty niche platform

It'd be interesting if there were ARC-like "garbage collection except really not" mechanisms in other languages.

Nomnom Cookie
Aug 30, 2009



Otto Skorzeny posted:

Yeah, this was the problem with Jikes and other similar schemes iirc. "We can guarantee* a pause will never take more than 100ms and that we can never have a fraction of cpu time given to the mutator of less that .4, which sounds much better than saying that gc can eat 60% of your time budget in exchange for soft real time performance that's a couple orders of magnitude too slow for anyone to care"
Zing does better than that and it's probably covered by 650 patents. From reading their paper it sounds like mutator/collector conflicts are detected and corrected when references are loaded from RAM so it's probably not *terrible* and it solves a real problem, but zing isn't going to increase QPS.

Nomnom Cookie
Aug 30, 2009



Shaggar posted:

it would seem like that would be a pretty popular feature for like a c#/java. maybe do that for strong references or w/e and let the gc handle the weak ones for u? ultimate combined lazyness+performance
This sounds like managed c++ or c++/cli, I forget. Maybe they're the same thing. Anyway no one used it and now it's dead.

Maximo Roboto
Feb 4, 2012

I guess ARC is neat but its principles are really only applicable to the reference counting nature of ObjC. And there really aren't any major manual memory managed languages left except for C and C-based languages.

tef
May 30, 2004

-> some l-system crap ->

Maximo Roboto posted:

It'd be interesting if there were ARC-like "garbage collection except really not" mechanisms in other languages.

can't think of any languages that do reference counting for you

X-BUM-RAIDER-X
May 7, 2008

Shaggar posted:

its mac only so theres no reason to ever use it.

Zombywuf
Mar 29, 2008

I really pity the guys who have to run the software written by you "memory usage doesn't matter" guys.

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag
gaaahhhhh http://badassjs.com/post/32812527381/doppio-a-java-virtual-machine-compiler-and

shameful

Max Facetime
Apr 18, 2009

holy poo poo the comments

I'm actually working on a toolchain for Clojure -> JVM Bytecode -> Decompile Bytecode into Java -> Doppio JavaScript -> CoffeeScript -> Back to JS -> Rhino Compiler to Bytecode -> GCJ for native machine code. This will be very useful for writing native programs in Clojure.

Shaggar
Apr 26, 2006

Zombywuf posted:

I really pity the guys who have to run the software written by you "memory usage doesn't matter" guys.

yeah ok rms. here in the year 2012 we have computers with more than 512k of ram.

Shaggar
Apr 26, 2006

Win8 Hetro Experie posted:

holy poo poo the comments

I'm actually working on a toolchain for Clojure -> JVM Bytecode -> Decompile Bytecode into Java -> Doppio JavaScript -> CoffeeScript -> Back to JS -> Rhino Compiler to Bytecode -> GCJ for native machine code. This will be very useful for writing native programs in Clojure.

this is why you stay away from those "languages" and everyone associated w/ them.

Nomnom Cookie
Aug 30, 2009



Zombywuf posted:

I really pity the guys who have to run the software written by you "memory usage doesn't matter" guys.

you know how it used to be 640k is enough for anyone. at my job it's 640GB is enough for anyone. you freak out about working set size, i'm using 2% of the ram on an underutilized machine

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Shaggar posted:

this is why you stay away from those "languages" and everyone associated w/ them.
Jvm and java especially

Shaggar
Apr 26, 2006
no, those are good.

Adbot
ADBOT LOVES YOU

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Zombywuf posted:

I really pity the guys who have to run the software written by you "memory usage doesn't matter" guys.

just write the program. use the clowniest data structures you want as long as it's not malicious. write the best code you can, but don't worry if it's not "perfect"

if memory or processor usage sql query performance or something proves to be a problem in actual usage, then fix it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply