Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Workaround mmap restrictions due to CONFIG_STRICT_DEVMEM #29

Copy link
Copy link

Description

@rbossy
Issue body actions

In systems where the kernel is compiled with option CONFIG_STRICT_DEVMEM, mmap is limited to 1MB: https://stackoverflow.com/questions/8213671/mmap-operation-not-permitted.

The marshalling framework uses mmap with the maximum available size, raising IOException:

public ByteBuffer getBuffer(long position) {
try {
long absPosition = startPosition + position;
long size = Math.min(channel.size() - absPosition, Integer.MAX_VALUE);
return channel.map(MapMode.READ_ONLY, absPosition, size);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}

Solution 1: tell users to recompile kernel. Not always possible.

Solution 2: mmap 1MB only. Problem is that the unmarshalled object might be larger than 1MB.

Solution 3: create a ByteBuffer based on 1MB mmap, but closes and reopens the mmap as needed.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.