A method for compressing data in a memory in an electronic device, the method comprising: identifying (S210, S510) a request for executing a camera application; determining (S220, S515) that a compression of data in the memory is required for the execution of the camera application, in case that a memory size required for the execution of the camera application is greater than an available memory size according to applications in progress in a background of the electronic device; selecting at least one application of the applications in progress in the background of the electronic device to be compressed comprising determining whether a priority list comprising prioritized applications for compression of data in the memory exists; determining, in case the priority list exists, whether the at least one application in progress in the background is included in the priority list; selecting the at least one application in progress in the background in case that it is included in the priority list; determining, in case the at least one application in progress in the background is not included in the priority list, whether a correlation of the at least one application in progress in the background with the camera application is to be considered; selecting, in case the correlation is to be considered, the at least one application in progress in the background having a low correlation with the camera application as the one to be compressed; and compressing (S230, S520) data corresponding to the selected at least one application and executing (S240, S525) the camera application, wherein the selected at least one application is a financial service application and has a low correlation with causes of a change in the electronic device status according to the request for executing the camera application, and wherein the at least one application does not include an application having a high correlation with the causes of a change in the electronic device status, the application including a social network service, SNS, application which uploads an image taken using the camera application. identifying (S210, S510) a request for executing a camera application; determining (S220, S515) that a compression of data in the memory is required for the execution of the camera application, in case that a memory size required for the execution of the camera application is greater than an available memory size according to applications in progress in a background of the electronic device; selecting at least one application of the applications in progress in the background of the electronic device to be compressed comprising determining whether a priority list comprising prioritized applications for compression of data in the memory exists; determining, in case the priority list exists, whether the at least one application in progress in the background is included in the priority list; selecting the at least one application in progress in the background in case that it is included in the priority list; determining, in case the at least one application in progress in the background is not included in the priority list, whether a correlation of the at least one application in progress in the background with the camera application is to be considered; selecting, in case the correlation is to be considered, the at least one application in progress in the background having a low correlation with the camera application as the one to be compressed; and determining whether a priority list comprising prioritized applications for compression of data in the memory exists; determining, in case the priority list exists, whether the at least one application in progress in the background is included in the priority list; selecting the at least one application in progress in the background in case that it is included in the priority list; determining, in case the at least one application in progress in the background is not included in the priority list, whether a correlation of the at least one application in progress in the background with the camera application is to be considered; selecting, in case the correlation is to be considered, the at least one application in progress in the background having a low correlation with the camera application as the one to be compressed; compressing (S230, S520) data corresponding to the selected at least one application and executing (S240, S525) the camera application, wherein the selected at least one application is a financial service application and has a low correlation with causes of a change in the electronic device status according to the request for executing the camera application, and wherein the at least one application does not include an application having a high correlation with the causes of a change in the electronic device status, the application including a social network service, SNS, application which uploads an image taken using the camera application.