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

Terminated due to memory issue on physical device #22

Open
bradleygolden opened this issue Apr 4, 2016 · 8 comments
Open

Terminated due to memory issue on physical device #22

bradleygolden opened this issue Apr 4, 2016 · 8 comments

Comments

@bradleygolden
Copy link

I've ran openalpr-ios on the simulator with success. Now I'm trying to run the project on an iPhone 6s (9.3.1) and each time I get the following output in my debug console:

Missing config value for runtime_dir
Missing config value for detector
Missing config value for detection_iteration_increase
Missing config value for detection_strictness
Missing config value for max_plate_width_percent
Missing config value for max_plate_height_percent
Missing config value for max_detection_input_width
Missing config value for max_detection_input_height
Missing config value for contrast_detection_threshold
Missing config value for must_match_pattern
Missing config value for skip_detection
Missing config value for detection_mask_image
Missing config value for analysis_count
Missing config value for prewarp
Missing config value for max_plate_angle_degrees
Missing config value for ocr_img_size_percent
Missing config value for state_id_img_size_percent
Missing config value for ocr_min_font_point
Missing config value for postprocess_min_confidence
Missing config value for postprocess_confidence_skip_level
Missing config value for debug_general
Missing config value for debug_timing
Missing config value for debug_prewarp
Missing config value for debug_detector
Missing config value for debug_state_id
Missing config value for debug_plate_lines
Missing config value for debug_plate_corners
Missing config value for debug_char_segment
Missing config value for debug_char_analysis
Missing config value for debug_color_filter
Missing config value for debug_ocr
Missing config value for debug_postprocess
Missing config value for debug_show_images
Missing config value for debug_pause_on_frame
Message from debugger: Terminated due to memory issue

I've enabled the "Address Sanitizer" under the "Diagnostics" tab to determine if I could find where the memory issue is occurring. After enabling, Address Sanitizer break points in PlateScanner.mm at this point in the code:

screen shot 2016-04-04 at 11 43 55 am

Address Sanitizer outputs this error in the console:

==1173==ERROR: AddressSanitizer failed to allocate 0x215a4000 (559562752) bytes of LargeMmapAllocator (error code: 12)
==1173==Process memory map follows:
    0x01955f4000-0x0195607000   /System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Libraries/libCGInterfaces.dylib
    0x01a19b4000-0x01a19b4034   /System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Libraries/libCGInterfaces.dylib
    0x01a00b0000-0x01a00b0bf8   /System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Libraries/libCGInterfaces.dylib

...

    #43 0x18865df6f in UIApplicationMain (/System/Library/Frameworks/UIKit.framework/UIKit+0x7df6f)
    #44 0x100055f33 in main (/var/containers/Bundle/Application/EB9E5DE6-CC0E-4126-A8CB-BCBA8D423DF5/AlprSample.app/AlprSample+0x100011f33)
    #45 0x182f268b7 in <redacted> (/usr/lib/system/libdyld.dylib+0x28b7)

I've noticed the app loads okay so long as I don't provide it an image, but this doesn't help me much. I'm not sure how to go about this issue.

@bradleygolden bradleygolden changed the title Terminated due to memory issue on physical devices Terminated due to memory issue on physical device Apr 4, 2016
@kstott
Copy link

kstott commented Apr 9, 2016

I am having exact same issue. If anyone has a solution, I would like to know.

@alvinbaena
Copy link

I'm also having the same issue, except I'm on an iPhone 4s with iOS 9.2.1.

@kstott
Copy link

kstott commented Apr 9, 2016

iOS 9.3, iPhone 6

@alvinbaena
Copy link

I managed to fix it by copying the contents of the openalpr.conf.defaults (from here) to the openalpr.conf that should be linked in the project.

When I say it works i mean it crashes after 4 detections (memory) and takes like 20 seconds instantiating the PlateScanner object, but it works.

Maybe the settings defined in the file should be tweaked for better performance, but I'm really new at this detection business.

@kstott
Copy link

kstott commented Apr 12, 2016

I believe the issue was:

max_detection_input_width = 1280
max_detection_input_height = 720

It now works for me as well - at least with one iteration. Second iteration never works. No errors, but it never recognizes plates even when using the exact same image.

@PhilippOtto89
Copy link

Same issue here. Any working solution?

@renatosc
Copy link

Same issue here. @alvinbaena solution above worked for me

@ducnmisbk
Copy link

as @alvinbaena 's solution, now i can build project to device but It can not recognize plate even when I used to do in simulator

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

6 participants