New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MirageOS on Xen: systematic crash with create_bounce_frame #731
Comments
I've created a lightweight version of my original Unikernel to make it easier to debug and figure where the error comes from. I've create a Gist with all the required resources. Just one suggestion, run |
@vitcozzolino the upload seems to be incomplete (the JSON ends in the middle of an entry). If I close all the open values, it works for me though. |
@talex5 I've re-uploaded the JSON.. can you try again now? Maybe something went wrong when I pasted the code. |
I was able to reproduce this as given with OCaml 4.02.3 and latest released versions of packages (obtained by |
@vitcozzolino I think you're running out of stack space because
|
@talex5 Thanks much, now it works! Unfortunately I've bumped into another issue.. I've stressed a bit the Unikernel and when I try to fetch too many rows I receive the following error:
On Unix it doesn't happen.. but I don't think that this is a coding error now. Are we running out of stack memory again? I'm trying to figure out how to expand it. |
Assuming your Xen unikernel really does have enough RAM, here are some known problem areas to consider: |
@talex5 Sorry, I forgot to reconfigure the available RAM for my Unikernel. Now I can go up to 4M rows fetched from the DB and that's already enough for my measurements. Thanks a lot for helping :) |
I'm curious where the stack size of Xen unikernels is configured, and if it is big enough for us (mirage/ocaml-git#151 seems to be related) -- on Solo5 I have not run into the stack size problem (maybe we should have the same stack size for Solo5 and for Xen!?). |
I was actually asking myself the same question but I was not able to find any references. I only found some Ocaml related information about how to change the stack size and how it works. At the moment I'm still able to trigger Anyway I would love to understand the correlation between available stack memory in the MirageOS PVM running on XEN and the amount of RAM I actually allocated into the |
@hannesm The stack size is in Mini-OS, upstream does it here: https://github.com/mirage/mini-os/blob/master/include/x86/arch_limits.h#L17, used at https://github.com/mirage/mini-os/blob/master/include/mm.h#L44. The Mirage fork will be similar, don't have a copy on hand. |
@mato thx, this is valuable information (and should be in some FAQ somewhere on the MirageOS website IMHO), related regarding memory tuning is Solo5/solo5#58 (comment) |
(you also get a lot more stack space on ARM: a little over 1MB: https://github.com/talex5/mini-os/blob/444542b05e0f8a6220129b90f4697563d4bd0e1b/arch/arm/arm32.S#L151) |
I just tried the |
@mato solo5 also does io-page allocation differently, or (see mirage/io-page#38) -- how (and where?) does solo5 actually implement the io-page primitive |
On 2016-12-20 18:19, Hannes Mehnert wrote:
@mato solo5 also does io-page allocation differently, or (see
mirage/io-page#38) -- how (and where?) does
solo5 actually implement the io-page primitive `caml_alloc_pages`?
It just calls malloc():
https://github.com/mirage/mirage-solo5/blob/master/lib/bindings/alloc_pages_stubs.c#L41
(Should probably be fixed, but nothing in the Solo5 devices actually
depends on page aligned buffers atm)
|
Hi, I've done some more tests to understand when the
I have been following the discussion but honestly I would like some help understanding the correlation between the out of memory error and the RAM allocated by the PVM. I'm fairly sure there is one considering that if I bump the RAM to 4GB I can complete successfully the 4M rows request. Why do I need so much RAM to handle such a small (proportionally) request? |
If you're getting |
I've tried with Will provide an updated gist and some more info as soon as possible. |
Hello! Did you find a solution to this problem? I'm working with Mirage on Xen and I'm having this same problem of "out of memory". |
Closing this issue because the original |
Hi,
I'm running a unikernel on XEN that basically accesses a remote DB, fetches and computes some data, sends out the result. Apparently, if I try to fetch and parse a JSON response greater than a empirically found threshold (details at the bottom of the post), the PVM XEN unikernel just crashes and this is wait I see when running
sudo xl dmesg
:I've tried to destroy/create multiple times the same unikernel and I always receive the same error. When running on Unix I don't bump into this issue, even when fetching multiple MB of data.
By filling my code with logs, I figured out where exactly the unikernel stops. Specifically during the JSON response parsing (I'm using the
YoJson
library):I know that probably my code is not really optimized and clean but I'm quite shocked to see that my unikernel crashes when it has to extract roughly 2800 datapoints (it's more or less the threshold at which it crashes). The function
computeAverage
is not even called. If I run the same code on Unix I can parse and process up to a 1M datapoints in less than a second.I've also tried to increase the number of vcpus and memory, but nothing changed (16 vcpus and 4GB of memory).
I would like to add that this threshold changes depending on the host machine:
The text was updated successfully, but these errors were encountered: