Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>> No you use the advisory bits when you map the memory.

Is that really what’s happening when we create another thread? That doesn’t fit with my understanding here. When i create a new thread, i expect its stack to be allocated before the break so mlock wouldn’t come into it. Even on a jvm with Xms smaller than Xmx (i.e. so the jvm could have to request to move the break and grow the heap to accomodate my new threads private jvm stack), I’m expecting you would have to explicitly request this behaviour somehow (because it’s quite unneighbourly and probably counter productive for most apps). I don’t know how you would do that, maybe there’s a call available under the unsafe packages?

I’m conscious I’m saying the jvm - i mean hotspot.

>> so it isn't unable to commit more memory while trying to handle an exception

Again this doesn’t fit with my understanding - you can receive a further OOME while handling an exception and that’s just bad luck.

>> Linux doesn't ignore even LOCKED does it? And it certainly can't ignore actual writes to pages

Sure but I’m going on the expectation that doesn’t apply here



> When i create a new thread, i expect its stack to be allocated before the break

Why? Stacks are just memory like any other. You can put them wherever you want.

> so the jvm could have to request to move the break and grow the heap

The JVM allocates heap space using mmap, not by moving the break.

> you can receive a further OOME while handling an exception and that’s just bad luck

If you're being reasonable you don't - the JVM maintains emergency heap storage (pre-committed!) space so it can keep allocating even when out-of-memory.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: