Skip to content
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

The requested array space is too large #198

Open
EkkoCrystal opened this issue Sep 24, 2024 · 2 comments
Open

The requested array space is too large #198

EkkoCrystal opened this issue Sep 24, 2024 · 2 comments

Comments

@EkkoCrystal
Copy link

    ImageInfo = koffi.struct({
        pixelTypeStr: 'int8[32]',
        pixelDataArr: koffi.array('int8_t', 5000000, 'Array')
    });

ERROR:crashpad_client_win.cc(844)] not connected

The requested array space is too large, causing problems.
How to deal with it in the electron project?
Block errors? Modify setting parameters?

@Koromix
Copy link
Owner

Koromix commented Sep 24, 2024

My guess is you need to increase the maximum type size, which is limited to 64 MiB (67108864 bytes) by default.

koffi.config({
    max_type_size: 536870912 // 512 MiB
})

More information here: https://koffi.dev/misc#memory-usage

@EkkoCrystal
Copy link
Author

@Koromix
Hello,
In the electron project, I am trying to read an image data of size 5M, 5 million bytes, which caused this problem
ImageInfo = koffi.struct({
widthUint: 'int8[4]',
heightUint: 'int8[4]',
sizeUint: 'int8[4]',
pixelDataArr: 'int8[5000000]'
});
const myStructInstance = koffi.decode(view, ImageInfo )

The last pixelDataArr has a problem. Trying int8[2048] is normal, but it also reports an error after multiple loops. I don't know where the problem is.Specific error information:
[38500:0925/130855.393:ERROR:crashpad_client_win.cc(844)] not connected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants