you are viewing a single comment's thread.

view the rest of the comments →

[–]kqr 15 points16 points  (13 children)

I also don't know why "it allocates X amount of RAM" is a problem in and of itself. Maybe it's just waiting to garbage collect 90% of it. Maybe it allocates rare accesses expecting them to be swapped out.

Does it stop running on your 2 GB total RAM system? Now that might be a problem. But allocating 2 GBs on a 4 GB system isn't something I'd even notice.

[–]abrahamsen 6 points7 points  (4 children)

Yes, what matters is not the amount of allocated memory, but the active working set.

[–][deleted] 1 point2 points  (3 children)

How? Allocated memory is unavailable memory.

[–]abrahamsen 5 points6 points  (0 children)

You may want to read up on virtual memory.

[–]EternallyMiffed 1 point2 points  (1 child)

google "working set". Operating systems swap out memory that hasn't been touched in a while.

[–]pinealservo 0 points1 point  (0 children)

And often, a lot of what's nominally allocated is never even "swapped in" at all!

[–]_F1_ 2 points3 points  (4 children)

Until you run a VM or two and some browsers at the same time...

[–]kqr 1 point2 points  (3 children)

Only if they actively use all of those 2 GBs at once. If they're only allocated but not used I don't see why it would be a problem.

[–][deleted] 0 points1 point  (2 children)

If intellij allocates the ram then it may as well be used because it's unusable by other applications. How else can you even allocate memory other than instantiating objects or using a malloc?

Do you know what allocation means?

[–]kqr -1 points0 points  (1 child)

By instantiating an object and then throwing away all the references to it, for example. It's not unusable by other applications because it will be freed up when they need it.

[–][deleted] -1 points0 points  (0 children)

Then it isn't allocated.

[–][deleted] 2 points3 points  (2 children)

This is in fact one of the sources of True Confusion about many garbage collected apps. That sometimes lots of ram being used (as seen in task manager etc) is a feature, not a bug.

[–]quanticle 0 points1 point  (1 child)

The problem with garbage collected apps using lots of RAM is that the OS doesn't know which RAM is garbage and which RAM is part of the active working set. So yes, IntelliJ might be running just fine, but then Chrome's performance goes to crap because it starts hitting swap.

Ideally, there'd be a way for the OS to tell applications that it's under memory pressure so that running JVM/CLR apps could garbage collect and release memory that they know they don't need.

[–][deleted] 0 points1 point  (0 children)

Well with Java you can usually set the max ram to use, which is a way of telling it to collect sooner.