-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Out of memory: cannot allocate 99010677309440-byte block #278
Comments
Looks like the problem is results isn't always the same type. When results contains at least one result, then objc.Call[[]vision.RecognizedTextObservation](request, objc.Sel("results")) ...works fine. But if there are zero results, then we get this crash. I found that this was because with one or more results, the returned class is Doing this check seemed to solve the problem obj := objc.Call[objc.Object](request, objc.Sel("results"))
count := objc.Call[uint64](obj, objc.Sel("count"))
if count == 0 {
return // empty results
}
results := objc.Call[[]vision.RecognizedTextObservation](request, objc.Sel("results")) This feels like the kind of thing that should be handled by these bindings. If not, this is a pretty big footgun. |
I had a similar issue, where calling
before calling |
@clarkmcc btw, minor nit, but this:
is effectively calling AFAIK, objc objects should only be initialized once, so its better to use |
I keep crashing my application so I am suspicious that I'm doing something wrong with the darwinkit API, which is translating to some invariant being violated somewhere. Here's the stacktrace:
This seems like it could be related to #277 and just manifesting itself in a different crash.
And here's the
ocr_engine_apple_darwin.go
fileThe text was updated successfully, but these errors were encountered: