-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Network] fix oom bug #4827
[Network] fix oom bug #4827
Conversation
Hm. Why did that happen in the first place. |
Old l. 139 constructs an array of all addresses which is later truncated to the number of requested addresses in l. 144. This fails on systems with low memory (on my development machine I wasn‘t able to reproduce it until I reduced the vm heap size). |
Ah ok. The problem is the But there is also an IPv4 matcher included. That should be removed, because the interface IPs are provided by |
I can add that there, too. But I need the matcher anyway to separate address and CIDR suffix, so it will result in a double check. |
Took some time but I have found it: There is a class in the core bundle (also in eclipse smarthome core) that wraps an InetAddress and a prefix length. We can just return that in That is a static method that makes the network binding method superfluous. |
I‘ll have a look. |
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
fe8cbb0
to
85609c2
Compare
Signed-off-by: Jan N. Klug <[email protected]>
85609c2
to
c3a901a
Compare
@davidgraeff, I also removed the exception handling whcih was only necessary if an invalid address was passed to |
Signed-off-by: Jan N. Klug <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix oom bug (openhab#4827) Signed-off-by: Jan N. Klug <[email protected]>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/network-binding-problem-heap-space/72243/2 |
fix oom bug (openhab#4827) Signed-off-by: Jan N. Klug <[email protected]> Signed-off-by: Pshatsillo <[email protected]>
fix oom bug (openhab#4827) Signed-off-by: Jan N. Klug <[email protected]> Signed-off-by: Maximilian Hess <[email protected]>
Fixes #3145
Large networks (like /8) caused an OOM exception because 16 million IP addresses were cconstructed during network discovery. This reduces the network size to the number of requested addresses (usually 255 which results in /24).
Verified locally.