Forced close on taking picture

COBRASoft

Active Member
Licensed User
Longtime User
Hey,

Here is a strange force close when trying to take a picture (res. 1280x960), it works fine at 640x480.

EDIT: I've replaced the code below with the latest log. From line 475 you can see the memory allocation problem. It asks for 1014490 bytes while 44% is still available. The first code below is where the error happens at the 'objJSon.Initialize(objMap)' in the 'PictureTaken' event. Is there a size limit with the JSonGenerator?

B4X:
            Dim objMap As Map: objMap.Initialize
            Shared.AddLogin(objMap)
            objMap.Put("PICTURE", Shared.GetBase64FromByteArray(Data, False, False, 0))
            Data = Null
            objMap.Put("NATIONALITY", "belgium")
            Dim objJSon As JSONGenerator: objJSon.Initialize(objMap)
            HttpUtils.PostString("LPRFromPicture", Shared.LPRFromPictureURL, objJSon.ToString, Shared.ContentType)

B4X:
2049873480 cald_camctrl.c                    (4526) 12433 P [SVR] 2049873450 + Cald_CamCtrl_ICamera_TakeSnapshot


2049873846 cald_camctrl.c                    (8980) 12433 P [SVR] 2049873816 + Cald_CamCtrl_FSM_Func_TakeSnapshot
2049875433 cald_camctrl.c                    (9110) 12433 P [SVR] 2049875403 - Cald_CamCtrl_FSM_Func_TakeSnapshot (0)
2049876715 cald_camctrl.c                    (4536) 12433 P [SVR] 2049876685 - Cald_CamCtrl_ICamera_TakeSnapshot (0)


mogami_calc_parameters.c flashledcalc_get_nvdata: if_torch_vr = 62500


mogami_calc_parameters.c flashledcalc_get_nvdata: vf_factory = 3100


mogami_calc_parameters.c flashledcalc_get_nvdata: v_batt_min = 3500
mogami_calc_parameters.c flashledcalc_get_nvdata: vdrop_ratio = 80
mogami_calc_parameters.c flashledcalc_get_nvdata: ratio_vdrop_torch = 50
mogami_calc_parameters.c flashledcalc_get_nvdata: ratio_vdrop_high = 50
mogami_calc_parameters.c flashledcalc_get_nvdata: eff_h = 80
mogami_calc_parameters.c flashledcalc_get_nvdata: eff_l = 68
mogami_calc_parameters.c flashledcalc_get_nvdata: drv_eff_threshold = 500000
mogami_calc_parameters.c flashledcalc_get_nvdata: c_redeye = 100
mogami_calc_parameters.c flashledcalc_get_nvdata: c_alien = 30
mogami_calc_parameters.c flashledcalc_get_nvdata: c_charging = 30
mogami_calc_parameters.c flashledcalc_get_nvdata: rtotal_min = 320
mogami_calc_parameters.c flashledcalc_get_nvdata: rtotal_offset = 0
mogami_calc_parameters.c flashledcalc_get_nvdata: t_rtotal_threshold = 20
mogami_calc_parameters.c flashledcalc_get_nvdata: c_rtotal[0] = 490
mogami_calc_parameters.c flashledcalc_get_nvdata: c_rtotal[1] = -28510
mogami_calc_parameters.c flashledcalc_get_nvdata: c_rtotal[2] = 701000
mogami_calc_parameters.c flashledcalc_get_nvdata: c_vdrop[0] = 0
mogami_calc_parameters.c flashledcalc_get_nvdata: c_vdrop[1] = 0
mogami_calc_parameters.c flashledcalc_get_nvdata: c_vdrop[2] = 0
mogami_calc_parameters.c flashledcalc_get_nvdata: c_vf[0] = -371000
mogami_calc_parameters.c flashledcalc_get_nvdata: c_vf[1] = 1070000
mogami_calc_parameters.c flashledcalc_get_nvdata: c_vf[2] = 2920000
mogami_calc_parameters.c flashledcalc_get_nvdata: c_vf_t = -2920
mogami_calc_parameters.c flashledcalc_get_nvdata: t_ref = 25
mogami_calc_parameters.c flashledcalc_get_nvdata: vf_ref = 3200
mogami_calc_parameters.c flashledcalc_get_nvdata: i_batt_max_high = 1000000
mogami_calc_parameters.c flashledcalc_get_nvdata: i_batt_max_torch = 1000000
mogami_calc_parameters.c flashledcalc_get_nvdata: max_if_flash = 1500000
mogami_calc_parameters.c flashledcalc_get_nvdata: max_if_torch_3a = 250000
mogami_calc_parameters.c flashledcalc_get_nvdata: v_batt_meas_range = 0
mogami_calc_parameters.c flashledcalc_get_nvdata: i_batt_meas_range = 0
mogami_calc_parameters.c flashledcalc_get_nvdata: if_flash_critical = 125000
mogami_calc_parameters.c flashledcalc_get_nvdata: if_torch_critical = 125000
flashled_calc.c flashledcalc_common_get_availablecurrent: File system access succeeded.
flashled_calc.c flashledcalc_common_get_availablecurrent: No flag is set, namely, Okay.
flashled_calc.c flashledcalc_common_get_availablecurrent: duration = 192, charging status = 1, t_batt = 30, r_batt = 320, v_batt = 4188, i_batt = 60000
flashled_calc.c flashledcalc_if_led_max: rtotal = 320, vdrop_max = 688, i_drv = 1720637, vdrop_est = 550
flashled_calc.c flashledcalc_if_led_max: if_led_max = 1394530
flashled_calc.c flashledcalc_status_effect: if_led_max = 418359
lm3560_flash.c chip_calc_if_fitval: if_led_max = 375000
flashled_calc.c flashledcalc_common_get_availablecurrent: calc_success
flashled_calc.c flashledcalc_flash_get_availablecurrent: if_led_max = 375000


mogami_calc_parameters.c flashledcalc_get_critical_torch: critical torch = 125000
mogami_calc_parameters.c flashledcalc_get_critical_torch: critical torch = 125000


mogami_calc_parameters.c flashledcalc_get_critical_torch: critical torch = 125000
2051268439 cald_camctrl.c                    (4115) 12441 P [SVR] 2051268408 + Cald_CamCtrl_ICBIqCtrl_PrepareSnapshotDone
2051268988 cald_capctrl.c                    (6468) 12435 P [CAP] 2051268958 + Cald_CapCtrl_FSM_Func_StartSnapshot
2051269141 cald_hal_qct.c                    (3054) 12435 P [HAL] 2051269110 + Cald_Hal_Qct_If_StopPreview
2051270300 cald_hal_qct.c                    (3087) 12435 P [HAL] 2051270270 - Cald_Hal_Qct_If_StopPreview (0)
2051270453 cald_hal_qct.c                    (7007) 12435 P [HAL] 2051270453 + Cald_Hal_Qct_If_DeleteImageConvert
2051271704 cald_hal_qct.c                    (7036) 12435 P [HAL] 2051271674 - Cald_Hal_Qct_If_DeleteImageConvert (0)
2051273291 cald_hal_qct.c                    (3100) 12435 P [HAL] 2051273261 + Cald_Hal_Qct_If_StartSnapshot
2051273840 cald_camctrl.c                    (4129) 12441 P [SVR] 2051273810 - Cald_CamCtrl_ICBIqCtrl_PrepareSnapshotDone (0)
2051637305 cald_hal_qct.c                    (3170) 12435 P [HAL] 2051637274 - Cald_Hal_Qct_If_StartSnapshot (0)


2051637488 cald_capctrl.c                    (6711) 12435 P [CAP] 2051637488 - Cald_CapCtrl_FSM_Func_StartSnapshot
2051637763 cald_capctrl.c                    (7036) 12435 P [CAP] 2051637763 + Cald_CapCtrl_FSM_Func_Hal_Shutter
2051637915 cald_camctrl.c                    (3940) 12435 P [SVR] 2051637885 + Cald_CamCtrl_ICBCapCtrl_CamShutter
2051638129 cald_camctrl.c                   (14363) 12435 P [SVR] 2051638129 + Cald_CamCtrl_FSM_Func_CamShutter
unknown stream type
unknown stream type
Routing audio to Speakerphone
Change routing audio to speaker for xLOUD
2051641394 cald_camctrl.c                    (4579) 12433 P [SVR] 2051641364 + Cald_CamCtrl_ICamera_CancelAutoLock
2051641791 cald_camctrl.c                   (14379) 12435 P [SVR] 2051641760 - Cald_CamCtrl_FSM_Func_CamShutter (0)
2051642096 cald_camctrl.c                    (3954) 12435 P [SVR] 2051642065 - Cald_CamCtrl_ICBCapCtrl_CamShutter (0)


2051642249 cald_capctrl.c                    (7046) 12435 P [CAP] 2051642249 - Cald_CapCtrl_FSM_Func_Hal_Shutter
2051642554 cald_camctrl.c                    (3987) 12435 P [SVR] 2051642523 + Cald_CamCtrl_ICBCapCtrl_ThumbnailDone
2051642798 cald_camctrl.c                   (14400) 12435 P [SVR] 2051642767 + Cald_CamCtrl_FSM_Func_ThumbnailDone
2051642981 cald_camctrl.c                   (14425) 12435 P [SVR] 2051642981 - Cald_CamCtrl_FSM_Func_ThumbnailDone (0)
2051643164 cald_camctrl.c                    (4002) 12435 P [SVR] 2051643134 - Cald_CamCtrl_ICBCapCtrl_ThumbnailDone (0)
2051643408 cald_capctrl.c                    (7261) 12435 P [CAP] 2051643408 + Cald_CapCtrl_FSM_Func_Hal_SnapshotImageDone
2051643561 cald_hal_qct.c                    (4852) 12435 P [HAL] 2051643561 + Cald_Hal_Qct_If_StartResize
2051644019 cald_hal_qct.c                    (4899) 12435 P [HAL] 2051643988 - Cald_Hal_Qct_If_StartResize (0)
2051644171 cald_capctrl.c                    (7364) 12435 P [CAP] 2051644141 - Cald_CapCtrl_FSM_Func_Hal_SnapshotImageDone
2051644537 cald_camctrl.c                    (9465) 12433 P [SVR] 2051644537 + Cald_CamCtrl_FSM_Func_CancelAutoLockOnSnapshot
2051644690 cald_camctrl.c                    (9483) 12433 P [SVR] 2051644690 - Cald_CamCtrl_FSM_Func_CancelAutoLockOnSnapshot (0)
2051644873 cald_camctrl.c                    (4584) 12433 P [SVR] 2051644843 - Cald_CamCtrl_ICamera_CancelAutoLock (0)
unknown stream type
unknown stream type
unknown stream type
unknown stream type
value of device and enable is 32 1
[36453.361541] [msm7x30.c:msm_device_put] device xloud_speaker_stereo_rx set 1
[36453.361602] [msm7x30.c:msm_device_put] device freq =48000
[36453.365264] [adsp.c:msm_adsp_get] module AFETASK has been registered
[36453.365325] [adsp.c:msm_adsp_enable] enable 'AFETASK'state[0] id[17227119]
[36453.369506] [adsp.c:adsp_rtos_mtoa_cb] rpc event=0, proc_id=2, module=17227119, image=0
[36453.369567] [adsp.c:adsp_rtos_mtoa_cb] module AFETASK: READY
2051700934 cald_capctrl.c                    (7522) 12435 P [CAP] 2051700903 + Cald_CapCtrl_FSM_Func_Hal_ResizeDone
2051701209 cald_hal_qct.c                    (4915) 12435 P [HAL] 2051701178 + Cald_Hal_Qct_If_StopResize
2051702704 cald_hal_qct.c                    (4945) 12435 P [HAL] 2051702673 - Cald_Hal_Qct_If_StopResize (0)
2051703406 cald_hal_qct.c                    (4740) 12435 P [HAL] 2051703375 + Cald_Hal_Qct_If_StartYuvToJpeg
2051704901 cald_hal_qct.c                    (4791) 12435 P [HAL] 2051704871 - Cald_Hal_Qct_If_StartYuvToJpeg (0)
2051705115 cald_capctrl.c                    (7618) 12435 P [CAP] 2051705084 - Cald_CapCtrl_FSM_Func_Hal_ResizeDone


2051734381 cald_capctrl.c                    (7638) 12435 P [CAP] 2051734381 + Cald_CapCtrl_FSM_Func_Hal_EncodeDone
2051734595 cald_hal_qct.c                    (4740) 12435 P [HAL] 2051734595 + Cald_Hal_Qct_If_StartYuvToJpeg
2051734961 cald_hal_qct.c                    (4791) 12435 P [HAL] 2051734961 - Cald_Hal_Qct_If_StartYuvToJpeg (0)
2051734992 cald_capctrl.c                    (7713) 12435 P [CAP] 2051734992 - Cald_CapCtrl_FSM_Func_Hal_EncodeDone
[36453.418792] VFS: Close: file count is 0
[36453.418823] VFS: Close: file count is 0
2051748511 cald_capctrl.c                    (7638) 12435 P [CAP] 2051748511 + Cald_CapCtrl_FSM_Func_Hal_EncodeDone
2051748633 cald_camctrl.c                    (4013) 12435 P [SVR] 2051748633 + Cald_CamCtrl_ICBCapCtrl_SnapshotDone
2051748694 cald_camctrl.c                   (14438) 12435 P [SVR] 2051748663 + Cald_CamCtrl_FSM_Func_SnapshotDone
2051748724 cald_camctrl.c                   (14483) 12435 P [SVR] 2051748724 - Cald_CamCtrl_FSM_Func_SnapshotDone (0)
2051748755 cald_camctrl.c                    (4029) 12435 P [SVR] 2051748755 - Cald_CamCtrl_ICBCapCtrl_SnapshotDone (0)
2051748785 cald_hal_qct.c                    (3182) 12435 P [HAL] 2051748785 + Cald_Hal_Qct_If_StopSnapshot
2051748816 cald_hal_qct.c                    (3211) 12435 P [HAL] 2051748816 - Cald_Hal_Qct_If_StopSnapshot (0)
2051748938 cald_capctrl.c                    (7713) 12435 P [CAP] 2051748938 - Cald_CapCtrl_FSM_Func_Hal_EncodeDone
2051749701 cald_capctrl.c                    (6371) 12435 P [CAP] 2051749670 + Cald_CapCtrl_FSM_Func_StopPreview
2051749731 cald_hal_qct.c                    (3054) 12435 P [HAL] 2051749731 + Cald_Hal_Qct_If_StopPreview
2051749762 cald_hal_qct.c                    (3087) 12435 P [HAL] 2051749762 - Cald_Hal_Qct_If_StopPreview (0)
2051749854 cald_capctrl.c                    (6382) 12435 P [CAP] 2051749854 - Cald_CapCtrl_FSM_Func_StopPreview
[36453.428039] msm_snddev_poweramp_on: power on amplifier
[36453.428131] [adsp.c:msm_adsp_get] module AUDPPTASK has been registered
[36453.428131] [adsp.c:msm_adsp_enable] enable 'AUDPPTASK'state[0] id[17227122]
[36453.431762] [adsp.c:adsp_rtos_mtoa_cb] rpc event=0, proc_id=2, module=17227122, image=0
[36453.431793] [adsp.c:adsp_rtos_mtoa_cb] module AUDPPTASK: READY
[36453.432922] VFS: Close: file count is 0
[36453.432952] VFS: Close: file count is 0
[36453.435943] [audpp.c:audpp_dsp_event] ENABLE


2051759985 cald_capctrl.c                    (6128) 12435 P [CAP] 2051759985 + Cald_CapCtrl_FSM_Func_StartPreview
2051760443 cald_hal_qct.c                    (2983) 12435 P [HAL] 2051760413 + Cald_Hal_Qct_If_StartPreview
[36453.440216] [adsp.c:msm_adsp_write] AUDPPTASK command took 37 attempts: rc 0
[36453.446319] msm_pp_release: pp not in progress for 0
2051772376 cald_hal_qct.c                    (3042) 12435 P [HAL] 2051772345 - Cald_Hal_Qct_If_StartPreview (0)
2051772406 cald_hal_qct.c                    (6612) 12435 P [HAL] 2051772406 + Cald_Hal_Qct_If_CreateImageConvert
2051773169 cald_hal_qct.c                    (6890) 12435 P [HAL] 2051773138 - Cald_Hal_Qct_If_CreateImageConvert (0)
2051773200 cald_capctrl.c                    (6358) 12435 P [CAP] 2051773200 - Cald_CapCtrl_FSM_Func_StartPreview
GC_CONCURRENT freed 1410K, 43% free 5161K/8967K, external 19871K/20890K, paused 1ms+3ms


GC_FOR_MALLOC freed 1337K, 46% free 5252K/9607K, external 18681K/20729K, paused 26ms


GC_FOR_MALLOC freed 614K, 45% free 5335K/9607K, external 18681K/20729K, paused 23ms


2052108771 cald_camctrl.c                   (14164) 12435 P [SVR] 2052108771 + Cald_CamCtrl_FSM_Func_FrameDoneVF


2052108862 cald_camctrl.c                   (14174) 12435 P [SVR] 2052108832 - Cald_CamCtrl_FSM_Func_FrameDoneVF


GC_FOR_MALLOC freed 1935K, 46% free 5308K/9671K, external 18681K/20729K, paused 26ms


GC_FOR_MALLOC freed 732K, 47% free 5200K/9671K, external 18681K/20729K, paused 24ms


GC_FOR_MALLOC freed 615K, 46% free 5280K/9671K, external 18681K/20729K, paused 25ms


AudioStreamOutMSM72xx::standby()


updateDeviceInfo: E rx_device 32 and tx_device 13
No active voicecall/playback, disabling cur_rx 32
value of device and enable is 32 0
No active voicecall/recording, disabling cur_tx 13
value of device and enable is 13 0
updateDeviceInfo: X cur_rx 32 cur_tx 13


[36456.520111] [msm7x30.c:msm_device_put] device xloud_speaker_stereo_rx set 0
[36456.521087] msm_snddev_poweramp_off: power off amplifier
[36456.523529] [adsp.c:msm_adsp_put] closing module AFETASK
[36456.523773] [msm7x30.c:msm_device_put] device speaker_mono_tx set 0
[36456.523834] [audpp.c:audpp_dsp_event] DISABLE
[36456.523864] [audpp.c:audpp_disable] Received CFG_MSG_DISABLE from ADSP
[36456.523864] [adsp.c:msm_adsp_disable] disable interrupt
[36456.523895] [adsp.c:msm_adsp_put] closing module AUDPPTASK
GC_CONCURRENT freed 1957K, 46% free 5315K/9671K, external 18681K/20729K, paused 1ms+5ms


GC_FOR_MALLOC freed 726K, 47% free 5213K/9671K, external 18681K/20729K, paused 23ms


GC_FOR_MALLOC freed 248K, 47% free 5183K/9671K, external 18681K/20729K, paused 21ms


GC_CONCURRENT freed 1903K, 46% free 5239K/9671K, external 18681K/20729K, paused 2ms+6ms


GC_FOR_MALLOC freed 1099K, 46% free 5271K/9671K, external 18681K/20729K, paused 24ms


GC_FOR_MALLOC freed 685K, 46% free 5281K/9671K, external 18681K/20729K, paused 23ms


GC_FOR_MALLOC freed 1883K, 46% free 5318K/9671K, external 18681K/20729K, paused 25ms


GC_FOR_MALLOC freed 905K, 46% free 5257K/9671K, external 18681K/20729K, paused 23ms


GC_FOR_MALLOC freed 1674K, 45% free 5390K/9671K, external 18681K/20729K, paused 29ms


GC_FOR_MALLOC freed 873K, 45% free 5446K/9863K, external 18681K/20729K, paused 23ms


GC_FOR_MALLOC freed 615K, 44% free 5527K/9863K, external 18681K/20729K, paused 22ms


GC_FOR_MALLOC freed 1776K, 45% free 5490K/9863K, external 18681K/20729K, paused 24ms


GC_FOR_MALLOC freed 637K, 45% free 5477K/9863K, external 18681K/20729K, paused 23ms


GC_FOR_MALLOC freed 607K, 44% free 5565K/9863K, external 18681K/20729K, paused 23ms


GC_FOR_MALLOC freed 1872K, 45% free 5580K/10055K, external 19711K/20729K, paused 25ms


GC_FOR_MALLOC freed 900K, 46% free 5524K/10055K, external 18681K/20729K, paused 23ms


GC_FOR_MALLOC freed 1927K, 47% free 5391K/10055K, external 18681K/20729K, paused 26ms


GC_FOR_MALLOC freed 868K, 46% free 5453K/10055K, external 18681K/20729K, paused 22ms


GC_FOR_MALLOC freed 607K, 45% free 5540K/10055K, external 18681K/20729K, paused 22ms


GC_FOR_MALLOC freed 1940K, 46% free 5511K/10055K, external 18681K/20729K, paused 25ms


GC_FOR_MALLOC freed 904K, 46% free 5451K/10055K, external 18681K/20729K, paused 26ms


GC_FOR_MALLOC freed 1908K, 46% free 5433K/10055K, external 18681K/20729K, paused 25ms


GC_FOR_MALLOC freed 1130K, 46% free 5453K/10055K, external 18681K/20729K, paused 22ms


GC_FOR_MALLOC freed 1870K, 46% free 5474K/10055K, external 18681K/20729K, paused 33ms


GC_FOR_MALLOC freed 1160K, 46% free 5464K/10055K, external 18681K/20729K, paused 23ms


GC_CONCURRENT freed 1924K, 45% free 5587K/10055K, external 18681K/20729K, paused 2ms+2ms


GC_FOR_MALLOC freed 1113K, 46% free 5454K/10055K, external 18681K/20729K, paused 23ms


2058096838 cald_camctrl.c                    (4579) 12433 P [SVR] 2058096838 + Cald_CamCtrl_ICamera_CancelAutoLock


2058096899 cald_camctrl.c                    (9432) 12433 P [SVR] 2058096899 + Cald_CamCtrl_FSM_Func_CancelAutoLock
2058096930 cald_camctrl.c                    (9454) 12433 P [SVR] 2058096930 - Cald_CamCtrl_FSM_Func_CancelAutoLock (0)
2058096961 cald_camctrl.c                    (4584) 12433 P [SVR] 2058096961 - Cald_CamCtrl_ICamera_CancelAutoLock (0)
2058097449 cald_capctrl.c                    (6371) 12435 P [CAP] 2058097449 + Cald_CapCtrl_FSM_Func_StopPreview
2058097479 cald_hal_qct.c                    (3054) 12435 P [HAL] 2058097479 + Cald_Hal_Qct_If_StopPreview
2058097846 cald_hal_qct.c                    (3087) 12435 P [HAL] 2058097846 - Cald_Hal_Qct_If_StopPreview (0)
2058097876 cald_hal_qct.c                    (7007) 12435 P [HAL] 2058097876 + Cald_Hal_Qct_If_DeleteImageConvert
2058098700 cald_hal_qct.c                    (7036) 12435 P [HAL] 2058098700 - Cald_Hal_Qct_If_DeleteImageConvert (0)


2058098944 cald_capctrl.c                    (6382) 12435 P [CAP] 2058098944 - Cald_CapCtrl_FSM_Func_StopPreview
GC_FOR_MALLOC freed 1906K, 46% free 5437K/10055K, external 18681K/20729K, paused 25ms


GC_FOR_MALLOC freed 1144K, 46% free 5442K/10055K, external 18681K/20729K, paused 23ms
GC_FOR_MALLOC freed 1906K, 46% free 5436K/10055K, external 18681K/20729K, paused 25ms


GC_FOR_MALLOC freed 1130K, 46% free 5455K/10055K, external 18681K/20729K, paused 25ms


GC_CONCURRENT freed 2165K, 47% free 5338K/10055K, external 18681K/20729K, paused 1ms+3ms


GC_FOR_MALLOC freed 1288K, 49% free 5222K/10055K, external 18681K/20729K, paused 35ms


2058874793 cald_camctrl.c                    (4579) 12433 P [SVR] 2058874762 + Cald_CamCtrl_ICamera_CancelAutoLock


2058874854 cald_camctrl.c                    (9432) 12433 P [SVR] 2058874854 + Cald_CamCtrl_FSM_Func_CancelAutoLock
2058874884 cald_camctrl.c                    (9454) 12433 P [SVR] 2058874884 - Cald_CamCtrl_FSM_Func_CancelAutoLock (0)
2058874915 cald_camctrl.c                    (4584) 12433 P [SVR] 2058874915 - Cald_CamCtrl_ICamera_CancelAutoLock (0)
2058875891 cald_camctrl.c                    (6724) 12433 P [SVR] 2058875891 + Cald_CamCtrl_PowerDown
2058875952 cald_camctrl.c                    (7569) 12433 P [SVR] 2058875952 + Cald_CamCtrl_FSM_Func_PowerDown
2058877295 cald_hal_qct.c                    (2863) 12433 P [HAL] 2058877295 + Cald_Hal_Qct_If_PowerDown


[36460.606597] mdp4_overlay_pipe_free: pipe=80740538 ndx=5
[36460.636566] mdp4_overlay_pipe_free: pipe=80740694 ndx=6


2059081000 cald_hal_qct.c                    (2891) 12433 P [HAL] 2059081000 - Cald_Hal_Qct_If_PowerDown (0)


2059082190 cald_camctrl.c                    (7607) 12433 P [SVR] 2059082159 - Cald_CamCtrl_FSM_Func_PowerDown (0)
2059082312 cald_camctrl.c                    (6729) 12433 P [SVR] 2059082312 - Cald_CamCtrl_PowerDown (0)
[36460.776641] mdp4_dtv_off


GC_CONCURRENT freed 1659K, 45% free 5610K/10055K, external 18681K/20729K, paused 1ms+2ms


GC_FOR_MALLOC freed 1142K, 46% free 5455K/10055K, external 18681K/20729K, paused 22ms


GC_CONCURRENT freed 1878K, 45% free 5625K/10055K, external 18681K/20729K, paused 2ms+3ms


GC_FOR_MALLOC freed 1098K, 46% free 5507K/10055K, external 18681K/20729K, paused 23ms


GC_CONCURRENT freed 2298K, 49% free 5197K/10055K, external 18681K/20729K, paused 2ms+2ms


GC_FOR_MALLOC freed 1155K, 49% free 5191K/10055K, external 18681K/20729K, paused 30ms


GC_CONCURRENT freed 1958K, 48% free 5281K/10055K, external 18681K/20729K, paused 2ms+2ms


GC_FOR_MALLOC freed 1287K, 49% free 5186K/10055K, external 18681K/20729K, paused 22ms


GC_CONCURRENT freed 1896K, 47% free 5338K/10055K, external 18681K/20729K, paused 1ms+2ms


GC_FOR_MALLOC freed 1337K, 49% free 5200K/10055K, external 18681K/20729K, paused 23ms


Jit: resizing JitTable from 4096 to 8192


GC_CONCURRENT freed 1930K, 48% free 5251K/10055K, external 19088K/20729K, paused 2ms+3ms


GC_FOR_MALLOC freed 1368K, 48% free 5235K/10055K, external 19088K/20729K, paused 24ms


GC_CONCURRENT freed 1916K, 48% free 5267K/10055K, external 19088K/20729K, paused 1ms+3ms


GC_FOR_MALLOC freed 1321K, 48% free 5298K/10055K, external 19088K/20729K, paused 24ms


GC_CONCURRENT freed 1970K, 47% free 5376K/10055K, external 19088K/20729K, paused 2ms+3ms


GC_FOR_MALLOC freed 1311K, 49% free 5228K/10055K, external 19088K/20729K, paused 23ms


GC_CONCURRENT freed 1991K, 48% free 5284K/10055K, external 19088K/20729K, paused 2ms+2ms


GC_CONCURRENT freed 2106K, 49% free 5199K/10055K, external 19088K/20729K, paused 2ms+2ms


GC_CONCURRENT freed 2077K, 49% free 5169K/10055K, external 19088K/20729K, paused 1ms+3ms


GC_CONCURRENT freed 1936K, 48% free 5280K/10055K, external 19088K/20729K, paused 1ms+3ms


GC_FOR_MALLOC freed 1664K, 48% free 5306K/10055K, external 19088K/20729K, paused 24ms


GC_CONCURRENT freed 2111K, 49% free 5168K/10055K, external 19088K/20729K, paused 1ms+3ms


GC_CONCURRENT freed 2067K, 50% free 5116K/10055K, external 19088K/20729K, paused 2ms+3ms


GC_CONCURRENT freed 2015K, 49% free 5139K/10055K, external 19088K/20729K, paused 2ms+2ms


GC_CONCURRENT freed 2078K, 50% free 5094K/10055K, external 19088K/20729K, paused 2ms+2ms


GC_CONCURRENT freed 1977K, 50% free 5063K/10055K, external 19088K/20729K, paused 2ms+2ms


GC_CONCURRENT freed 1717K, 47% free 5393K/10055K, external 19088K/20729K, paused 2ms+2ms


GC_FOR_MALLOC freed 1963K, 48% free 5323K/10055K, external 19088K/20729K, paused 25ms


GC_FOR_MALLOC freed 781K, 46% free 5528K/10055K, external 19088K/20729K, paused 22ms


Grow heap (frag case) to 27.331MB for 1014368-byte allocation
GC_FOR_MALLOC freed 32K, 42% free 6486K/11079K, external 19088K/20729K, paused 22ms


GC_FOR_MALLOC freed 1905K, 43% free 6329K/11079K, external 19088K/20729K, paused 25ms


GC_FOR_MALLOC freed 653K, 44% free 6244K/11079K, external 19088K/20729K, paused 22ms
GC_FOR_MALLOC freed 807K, 44% free 6257K/11079K, external 19088K/20729K, paused 22ms


Grow heap (frag case) to 28.043MB for 1014446-byte allocation
GC_FOR_MALLOC freed 28K, 41% free 7220K/12103K, external 19088K/20729K, paused 21ms


GC_FOR_MALLOC freed 2K, 41% free 7218K/12103K, external 19088K/20729K, paused 22ms


Grow heap (frag case) to 29.465MB for 1521664-byte allocation
GC_FOR_MALLOC freed 1K, 37% free 8703K/13639K, external 19088K/20729K, paused 22ms


GC_FOR_MALLOC freed 990K, 44% free 7712K/13639K, external 19088K/20729K, paused 22ms


GC_FOR_MALLOC freed 1486K, 48% free 7216K/13639K, external 19088K/20729K, paused 22ms
GC_CONCURRENT freed 2981K, 55% free 6245K/13639K, external 19088K/20729K, paused 2ms+3ms


GC_CONCURRENT freed 1850K, 54% free 6361K/13639K, external 19088K/20729K, paused 2ms+3ms


GC_FOR_MALLOC freed 404K, 48% free 7222K/13639K, external 19088K/20729K, paused 21ms


GC_FOR_MALLOC freed 994K, 44% free 7714K/13639K, external 19088K/20729K, paused 22ms


GC_CONCURRENT freed 1535K, 40% free 8227K/13639K, external 19088K/20729K, paused 1ms+3ms


GC_FOR_MALLOC freed 3733K, 54% free 6378K/13639K, external 19088K/20729K, paused 24ms


GC_FOR_MALLOC freed 1441K, 55% free 6252K/13639K, external 19088K/20729K, paused 23ms


GC_FOR_MALLOC freed 23K, 48% free 7219K/13639K, external 19088K/20729K, paused 22ms


GC_FOR_MALLOC freed 992K, 44% free 7712K/13639K, external 19088K/20729K, paused 21ms


Forcing collection of SoftReferences for 1014490-byte allocation
GC_FOR_MALLOC freed 2K, 44% free 7710K/13639K, external 19088K/20729K, paused 21ms
Out of memory on a 1014490-byte allocation.
"main" prio=5 tid=1 RUNNABLE
  | group="main" sCount=0 dsCount=0 obj=0x2aad2260 self=0xd168
  | sysTid=12401 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=1876218976
  at java.lang.String.<init>(String.java:~513)
  at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:650)
  at java.lang.StringBuilder.toString(StringBuilder.java:664)
  at java.util.AbstractMap.toString(AbstractMap.java:458)
  at anywheresoftware.b4a.objects.collections.Map$MyMap.toString(Map.java:217)
  at anywheresoftware.b4a.AbsObjectWrapper.toString(AbsObjectWrapper.java:110)
  at java.lang.String.valueOf(String.java:1860)
  at anywheresoftware.b4a.debug.Debug.objectToString(Debug.java:356)
  at anywheresoftware.b4a.debug.Debug.writeLocals(Debug.java:292)
  at anywheresoftware.b4a.debug.Debug.sendBPData(Debug.java:255)
  at anywheresoftware.b4a.debug.Debug.access$9(Debug.java:251)
  at anywheresoftware.b4a.debug.Debug$1.run(Debug.java:228)
  at android.os.Handler.handleCallback(Handler.java:587)
  at android.os.Handler.dispatchMessage(Handler.java:92)
  at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:199)
  at anywheresoftware.b4a.Msgbox.debugWait(Msgbox.java:146)
  at anywheresoftware.b4a.debug.Debug.wait(Debug.java:185)
  at anywheresoftware.b4a.debug.Debug.reachBP(Debug.java:232)
  at anywheresoftware.b4a.debug.Debug.ShouldStop(Debug.java:204)
  at q2c.m4a.main._objcamera_picturetaken(main.java:4319)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at anywheresoftware.b4a.BA.raiseEvent2(BA.java:113)
  at anywheresoftware.b4a.BA.raiseEvent2(BA.java:101)
  at anywheresoftware.b4a.BA.raiseEvent(BA.java:97)
  at xvs.ACL.ACL$4.onPictureTaken(ACL.java:239)
  at android.hardware.Camera$EventHandler.handleMessage(Camera.java:529)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:130)
  at android.app.ActivityThread.main(ActivityThread.java:3701)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
  at dalvik.system.NativeStart.main(Native Method)

Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
FATAL EXCEPTION: main
java.lang.OutOfMemoryError
    at java.lang.String.<init>(String.java:513)
    at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:650)
    at java.lang.StringBuilder.toString(StringBuilder.java:664)
    at java.util.AbstractMap.toString(AbstractMap.java:458)
    at anywheresoftware.b4a.objects.collections.Map$MyMap.toString(Map.java:217)
    at anywheresoftware.b4a.AbsObjectWrapper.toString(AbsObjectWrapper.java:110)
    at java.lang.String.valueOf(String.java:1860)
    at anywheresoftware.b4a.debug.Debug.objectToString(Debug.java:356)
    at anywheresoftware.b4a.debug.Debug.writeLocals(Debug.java:292)
    at anywheresoftware.b4a.debug.Debug.sendBPData(Debug.java:255)
    at anywheresoftware.b4a.debug.Debug.access$9(Debug.java:251)
    at anywheresoftware.b4a.debug.Debug$1.run(Debug.java:228)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:199)
    at anywheresoftware.b4a.Msgbox.debugWait(Msgbox.java:146)
    at anywheresoftware.b4a.debug.Debug.wait(Debug.java:185)
    at anywheresoftware.b4a.debug.Debug.reachBP(Debug.java:232)
    at anywheresoftware.b4a.debug.Debug.ShouldStop(Debug.java:204)
    at q2c.m4a.main._objcamera_picturetaken(main.java:4319)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:113)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:101)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:97)
    at xvs.ACL.ACL$4.onPictureTaken(ACL.java:239)
    at android.hardware.Camera$EventHandler.handleMessage(Camera.java:529)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3701)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)


    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
    at dalvik.system.NativeStart.main(Native Method)
  Force finishing activity q2c.m4a/.main
Activity pause timeout for HistoryRecord{2b14b548 q2c.m4a/.main}


No longer want com.facebook.katana (pid 11961): hidden #16


set_light_backlight: brightness=20


Activity destroy timeout for HistoryRecord{2b14b548 q2c.m4a/.main}


set_light_backlight: brightness=155


Sending signal. PID: 12401 SIG: 9


channel '2b36e528 q2c.m4a/q2c.m4a.main (server)' ~ Consumer closed input channel or an error occurred.  events=0x8


channel '2b36e528 q2c.m4a/q2c.m4a.main (server)' ~ Channel is unrecoverably broken and will be disposed!
Unneeded remove listener for uid 1000
loc_eng_stop


Process q2c.m4a (pid 12401) has died.
WIN DEATH: Window{2b36e528 q2c.m4a/q2c.m4a.main paused=false}
WIN DEATH: Window{2b38de08 q2c.m4a/q2c.m4a.main paused=false}
WIN DEATH: Window{2b355820 q2c.m4a/q2c.m4a.main paused=false}
Got RemoteException sending setActive(false) notification to pid 12401 uid 10139
[36483.858184] binder: 367:367 transaction failed 29189, size 88-0
loc_eng_send_gps_status: status = 4
GC_CONCURRENT freed 1671K, 40% free 7482K/12295K, external 5373K/6217K, paused 8ms+13ms


openFile -- START uri=content://com.sonyericsson.provider.customization/settings/com.sonyericsson.textinput.uxp
No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml
loc_eng_send_gps_status: status = 4
set_light_backlight: brightness=20
Greetings,
Sigurd
 
Last edited:

COBRASoft

Active Member
Licensed User
Longtime User
Hi Erel,

Unfortunately, this helps only in some cases. Once it works, another time it doesn't.

I really don't get it. I don't draw anything anymore, I just use some basic views and I still run out of memory. Is there something wrong with the JSonGenerator, HttpUtils, BluetoothAdmin, Serial, GPS, ...?

Greetings,
Sigurd
 
Upvote 0

COBRASoft

Active Member
Licensed User
Longtime User
Hi Erel,

It is in fact the same problem as the double start problem thread. After some time, the memory is filled up and not released.

I've changed my app a lot and now it uses a lot less memory (still filling up though, but slower).

The main reason was because of a canvas I used to calculate the length of a string for my scrollviews. I used a separate canvas each time for this. For some reason this memory is not being freed like it should IMO. I use a shared canvas based on a mutable bitmap now for this.

Greetings,
Sigurd
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
B4X:
            Dim objMap As Map: objMap.Initialize
            Shared.AddLogin(objMap)
            objMap.Put("PICTURE", Shared.GetBase64FromByteArray(Data, False, False, 0))
            Data = Null
            objMap.Put("NATIONALITY", "belgium")
            Dim objJSon As JSONGenerator: objJSon.Initialize(objMap)
            HttpUtils.PostString("LPRFromPicture", Shared.LPRFromPictureURL, objJSon.ToString, Shared.ContentType)



So taking pictures at 1280x960 = Data = 4.6875 MB)
You take one picture and post it, HttpUtilsService still retains PostData as it is never cleared. You will always have 4.6875MB allocated unnecessarily.
point:


B4X:
Sub objCamera_PictureTaken (Data() As Byte) '2xData allocated at this point

            Dim objMap As Map: objMap.Initialize
            objMap.Put("PICTURE", Shared.GetBase64FromByteArray(Data, False, False, 0)) ' 3xData allocated at this point
            Data = Null '2xData allocated at this point
            Dim objJSon As JSONGenerator: objJSon.Initialize(objMap)
            HttpUtils.PostString("LPRFromPicture", Shared.LPRFromPictureURL, objJSon.ToString, Shared.ContentType) '3xData allocated at this point until HttpUtilsServce.PostData is reassigned

where 3xData = 14.0625 MB ...not leaving you much room for anything else
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
I would actually recommend saving the file as a jpeg and then reading it from sdcard to POST it as Erel says.
Unless there is a reason why you need to preserve quality (doing post-processing) a JPEG should be fine.
If you need to preserve quality you can use a lossless jpeg or zip, the bitmap.
Processing wise, jpeg will give you better performance and less overhead (and maybe Hardware acceleration).

You can also clear the PostData variable in the 'JobDone' sub manually.
 
Upvote 0

COBRASoft

Active Member
Licensed User
Longtime User
I still have to write the code for the JPG save/load part. I know this :). But even then, a high resolution (8MP) picture will be quite big and when I take several of these pictures and try to rotate them, memory problems. It is quite possible it is the limitation of Android.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
I still have to write the code for the JPG save/load part. I know this :). But even then, a high resolution (8MP) picture will be quite big and when I take several of these pictures and try to rotate them, memory problems. It is quite possible it is the limitation of Android.
Be careful with high res pictures, any leaks will cause problems again.
And rotation...there is nothing that thrashes the memory bandwidth like rotation!
 
Upvote 0
Top