CN105808412A - Process resource real-time monitoring method - Google Patents

Process resource real-time monitoring method Download PDF

Info

Publication number
CN105808412A
CN105808412A CN201410848665.8A CN201410848665A CN105808412A CN 105808412 A CN105808412 A CN 105808412A CN 201410848665 A CN201410848665 A CN 201410848665A CN 105808412 A CN105808412 A CN 105808412A
Authority
CN
China
Prior art keywords
resource occupation
occupation information
resource
threshold value
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410848665.8A
Other languages
Chinese (zh)
Inventor
马自娇
付志伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Tianjin Co Ltd
Original Assignee
Spreadtrum Communications Tianjin Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Tianjin Co Ltd filed Critical Spreadtrum Communications Tianjin Co Ltd
Priority to CN201410848665.8A priority Critical patent/CN105808412A/en
Publication of CN105808412A publication Critical patent/CN105808412A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention belongs to the field of electronic information, and specifically relates to a process resource real-time monitoring method which is applied to an android system. The method comprises the following steps: collecting resource occupation information of a running predetermined process; judging whether the collected resource occupation information exceeds a predetermined threshold value or not; recording a log file corresponding to the process, the resource occupation information of which is collected, and ending the process if the collected resource occupation information exceeds the predetermined threshold value. Through the implementation of the method provided by the invention, the users can monitored the resource occupation information of the predetermined running processes, and when a resource overflow problem occurs, the users can be helped to end the processes with the problem and related logs are stored so that the users can analyze the reasons of the problem.

Description

A kind of process resource method of real-time
Technical field
The invention belongs to electronic information field, be specifically related to a kind of process resource method of real-time.
Background technology
Along with the development of electronic mobile device, the application of andriod system is more and more, along with popularizing of andriod system application, the requirement of its performance is more and more higher.
Andriod system belongs to embedded system, and for embedded system, the resource exceptions such as internal memory are valuable, the resource occupation of process is not only closely bound up with the performance of system, if owing to internal memory, process too much cause that resource is revealed also affects system stability in the large, for problems, andriod self has the mechanism that monitoring andriod process resource overflows, the resource occupation of all processes is set the unified upper limit, effectively prevent resource leakage problem.
But this mechanism can only to the unified upper limit of the resource settings of all processes of andriod platform, only that resource leakage problem is helpful, and according to the demand of user, internal memory, process etc. can not be set the different upper limit, and it is not the unified upper limit that all processes are set takes long enough cruelly to spill, the preservation of field data is comprehensive.Therefore, how the internal memory of andriod platform, process are set the different upper limits, and record field data becomes a great problem that those skilled in the art face comprehensively.
Summary of the invention
In order to solve the problems referred to above, the present invention proposes a kind of process resource method of real-time being applied to Android system, by gathering the resource occupation information of the preset course being currently running, then judge whether the resource occupation information collected exceedes the predetermined threshold value of correspondence, if it exceeds predetermined threshold value, then record gathers the corresponding journal file of the process of resource occupation information and terminates this process.Method particularly includes:
A kind of process resource method of real-time, is applied to Android system, and wherein, described method includes:
The resource occupation information of the preset course that step a, collection are currently running;
Step b, judge the threshold value whether described resource occupation information preset more than one;
Step c, described resource occupation information exceed as described in threshold value, then record the daily record of described process of correspondence, and the described process terminating correspondence run.
Said method, wherein, stores the process title needing real-time monitoring and the threshold value that resource occupation information is corresponding accordingly in a storage element.
Said method, wherein, described step a includes:
Step a1, in described storage element, read the described process title of storage, and judge whether process corresponding to described process title is currently running;
Step a2, the process being currently running in process corresponding to the described process title read in described step a1 is gathered resource occupation information.
Said method, wherein, described step b includes:
Step b1, in described storage element, read the process title that the described resource occupation information collected is corresponding;
Step b2, threshold value according to resource occupation information corresponding to the described process name acquiring process title read in described step b1;
Step b3, according to whether the described resource occupation information that collects of described threshold decision obtained in described step b2 exceedes described threshold value.
Said method, wherein, described storage element is a text.
Said method, wherein, described resource occupation information includes EMS memory occupation amount, and/or opens file handle number, and/or the number of threads created.
Said method, wherein, in described step c, described daily record includes:
Hprof file that process is corresponding and the information that process is obtained by showmap method;
And/or the information that process is obtained by list open files;
And/or the information of each thread of process creation.
Said method, wherein, in described step c, described daily record is with the described process naming of current time in system and correspondence.
Said method, wherein, in described step c, described daily record is deposited under same path.
Advantages of the present invention and the beneficial effect reached:
By the enforcement to the technical program, user can monitor the resource occupation information of the predetermined process being currently running, when there being resource overflow problem to occur, user can be helped to terminate the operation of process of generation problem and preserve the relevant daily record reason for customer analysis generation problem.
Accompanying drawing explanation
Accompanying drawing 1 is process resource method of real-time flow chart of the present invention;
Accompanying drawing 2 is the resource occupation information flow chart of the preset course that collection of the present invention is currently running;
Whether the resource occupation information that accompanying drawing 3 is the preset course that the present invention judges to be currently running exceedes predetermined threshold flow chart;
Accompanying drawing 4 is the threshold value memory structure schematic diagram of the process title of the present invention and correspondence.
Embodiment
Below in conjunction with accompanying drawing and specific embodiment, the present invention is further illustrated, but not as limiting to the invention.
With reference to flow chart shown in accompanying drawing 1, embodiments of the invention include a kind of process resource method of real-time, are applied to Android system, wherein, comprise the steps:
The resource occupation information of the preset course that step a, collection are currently running;
Step b, judge the threshold value whether resource occupation information preset more than one;
Step c, as resource occupation information exceedes threshold value, then record the daily record of process of correspondence, and the process terminating correspondence run.
Technique scheme, by the process being currently running in Android system is gathered resource occupation information, and determine whether whether the resource occupation information collected exceedes default threshold value, when occurring resource occupation to overflow (when resource occupation information exceedes default threshold value), the process making generation problem is out of service, and preserves relevant daily record.Android system user can pass through the setting to threshold value, controls and Optimization Progress taking resource, and when process is stopped because resource occupation overflows, can pass through to analyze the daily record preserved, it is thus achieved that the reason of problem occurs.
As a kind of preferred embodiment, the process title needing real-time monitoring and the threshold value that resource occupation information is corresponding accordingly can be stored in a storage element.
This storage element can be edited by Android system user, add or amendment wherein needs the real-time process title monitored, and arrange or adjust corresponding threshold value, thus the process realizing user in system is concerned about is monitored, and control and Optimization Progress taking resource.
As a kind of preferred embodiment, with reference to shown in accompanying drawing 2, step a includes:
Step a1, in storage element, read the process title of storage, and judge whether process corresponding to process title is currently running;
Step a2, the process being currently running in process corresponding to the process title read in step a1 is gathered resource occupation information.
Technique scheme, read the title of the predetermined process to monitor being stored in storage element and according to the name query of process to this process, see whether this process is in running status, when judging that obtaining this process is in running status, just gather this process resource occupied information and be positioned in bin by corresponding with process title for this resource occupation information, in order to subsequent step uses.
As a kind of preferred embodiment, with reference to shown in accompanying drawing 3, step b includes:
Step b1, in storage element, read the process title that the resource occupation information collected is corresponding;
Step b2, threshold value according to resource occupation information corresponding to the process name acquiring process title read in step b1;
Step b3, according to whether the resource occupation information that collects of threshold decision obtained in step b2 exceedes threshold value.
Technique scheme, android user's title according to the process gathering resource occupation information being stored in storage element, read the resource occupation information threshold for this process set, and this threshold value is made comparisons with the resource occupation information collected, if threshold value exceedes the resource occupation information of process, then judge resource spillover, record corresponding journal file, and terminate this process.
As a kind of preferred embodiment, storage element can be a text, text file content can be edited or revise by android user, the form of the threshold value that the resource occupation information of process wherein stored in text and android user set according to user need store, use to facilitate in user's subsequent step.
With reference to shown in accompanying drawing 4, Fig. 4 illustrates the text example as storage element, the title of process is shown in wherein corresponding for #name list, the EMS memory occupation amount of process is shown in list corresponding for #fd, list corresponding for #pss is shown and is opened file handle number in process, what list corresponding for #thread was shown is the number of threads of process creation, if needing to monitor the EMS memory occupation amount of certain or certain several processes, open file handle number, in the number of threads created one or several, then set corresponding threshold value at the row wanting monitoring process corresponding, as a certain item or several need not be monitored, can be then 0 by setting value in wanting the row that monitoring process is corresponding.
As a kind of preferred embodiment, resource occupation information can include EMS memory occupation amount, open the number of threads of file handle number and establishment.
Android user can pass through EMS memory occupation amount understand operation process EMS memory occupation situation, by open file handle number understand this operation process open at present file number, by create number of threads determine this process run create thread how many.By this resource occupation information, android user can understand the occupation condition of this operation process in time.
As a kind of preferred embodiment, in step c, daily record comprises the steps that
Hprof file that process is corresponding and the information that process is obtained by showmap method, the information that process is obtained by list open files, process creation the information of each thread.
Hprof file is the file of the process stacks service condition for preserving generated by HProf instrument integrated in JDK, can be made directly preservation at native layer (primary layer), to facilitate user to call.Showmap is android instruction, the memory usage information of process java and the native for preserving.Lsof lists system to open the instrument of file, collects, by kernel (system kernel) information dished out, the file handle information that corresponding process is opened,
Further, in step c, daily record can the process naming of current time in system and correspondence.
Daily record is named with the process title of system current time and correspondence, and user it will be seen that the title of the process of generation problem and the reason of this process generation problem, and record has the time of process generation problem simultaneously, facilitates customer analysis.
Further, in step c, daily record can be deposited under same path, facilitates user to inquire about.
The technical program can be used for the monkey (performance testing tool that Android system firmware carries, the events such as various button, touch screen can be simulated) test in, the technical program is associated with monkey test, when there being resource spillover to occur in monitoring process, system is tested at the monkey that can terminate stopping the process that generation resource is overflowed simultaneously.
In sum, the present invention is by a kind of process resource method of real-time, effectively whether the information resources of the setting that monitoring is applied to the predetermined process of Android system there is spillover, when there being resource overflow problem to occur, user can be helped to terminate the operation of process of generation problem and preserve the relevant daily record reason for customer analysis generation problem.
It should be appreciated by those skilled in the art that those skilled in the art are realizing described change case in conjunction with prior art and above-described embodiment, do not repeat at this.Such change case has no effect on the flesh and blood of the present invention, does not repeat them here.
Above presently preferred embodiments of the present invention is described.It is to be appreciated that the invention is not limited in above-mentioned particular implementation, the equipment and the structure that are not wherein described in detail to the greatest extent are construed as and are practiced with the common mode in this area;Any those of ordinary skill in the art, without departing under technical solution of the present invention ambit, all may utilize the method for the disclosure above and technology contents and technical solution of the present invention is made many possible variations and modification, or it being revised as the Equivalent embodiments of equivalent variations, this has no effect on the flesh and blood of the present invention.Therefore, every content without departing from technical solution of the present invention, the technical spirit of the foundation present invention, to any simple modification made for any of the above embodiments, equivalent variations and modification, all still falls within the scope of technical solution of the present invention protection.

Claims (9)

1. a process resource method of real-time, is applied to Android system, it is characterised in that described method includes:
The resource occupation information of the preset course that step a, collection are currently running;
Step b, judge the threshold value whether described resource occupation information preset more than one;
Step c, described resource occupation information exceed as described in threshold value, then record the daily record of described process of correspondence, and the described process terminating correspondence run.
2. method as claimed in claim 1, it is characterised in that store the process title needing real-time monitoring and the threshold value that resource occupation information is corresponding accordingly in a storage element.
3. method as claimed in claim 2, it is characterised in that described step a includes:
Step a1, in described storage element, read the described process title of storage, and judge whether process corresponding to described process title is currently running;
Step a2, the process being currently running in process corresponding to the described process title read in described step a1 is gathered resource occupation information.
4. method as claimed in claim 2, it is characterised in that described step b includes:
Step b1, in described storage element, read the process title that the described resource occupation information collected is corresponding;
Step b2, threshold value according to resource occupation information corresponding to the described process name acquiring process title read in described step b1;
Step b3, according to whether the described resource occupation information that collects of described threshold decision obtained in described step b2 exceedes described threshold value.
5. method as claimed in claim 2, it is characterised in that described storage element is a text.
6. method as claimed in claim 1, it is characterised in that described resource occupation information includes EMS memory occupation amount, and/or opens file handle number, and/or the number of threads created.
7. method as claimed in claim 1, it is characterised in that in described step c, described daily record includes:
Hprof file that process is corresponding and the information that process is obtained by showmap method;
And/or the information that process is obtained by list open files;
And/or the information of each thread of process creation.
8. method as claimed in claim 1, it is characterised in that in described step c, described daily record is with the described process naming of current time in system and correspondence.
9. method as claimed in claim 1, it is characterised in that in described step c, described daily record is deposited under same path.
CN201410848665.8A 2014-12-30 2014-12-30 Process resource real-time monitoring method Pending CN105808412A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410848665.8A CN105808412A (en) 2014-12-30 2014-12-30 Process resource real-time monitoring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410848665.8A CN105808412A (en) 2014-12-30 2014-12-30 Process resource real-time monitoring method

Publications (1)

Publication Number Publication Date
CN105808412A true CN105808412A (en) 2016-07-27

Family

ID=56421058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410848665.8A Pending CN105808412A (en) 2014-12-30 2014-12-30 Process resource real-time monitoring method

Country Status (1)

Country Link
CN (1) CN105808412A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106781094A (en) * 2016-12-29 2017-05-31 北京安天网络安全技术有限公司 A kind of ATM system resource exception warning system and method
CN107179950A (en) * 2017-06-29 2017-09-19 努比亚技术有限公司 A kind of application process processing method, mobile terminal and computer-readable recording medium
CN107463642A (en) * 2017-07-19 2017-12-12 北京京东尚科信息技术有限公司 The method and apparatus for lifting Tool for Data Warehouse resource utilization
CN109412884A (en) * 2018-08-21 2019-03-01 平安科技(深圳)有限公司 Performance data acquisition method, device and storage medium, the server of component
CN109982144A (en) * 2019-03-12 2019-07-05 四川长虹电器股份有限公司 Monitor and judge the automated testing method that application process CPU occupies superelevation and alarms
CN111131815A (en) * 2019-12-18 2020-05-08 苏宁智能终端有限公司 Smart television performance monitoring and abnormal process processing method and device
CN111258847A (en) * 2020-01-13 2020-06-09 北京字节跳动网络技术有限公司 File handle monitoring and analyzing method, device, medium and equipment
CN111274060A (en) * 2020-02-10 2020-06-12 广州虎牙科技有限公司 Method, device, equipment and storage medium for determining memory abnormity
CN113032207A (en) * 2021-03-02 2021-06-25 广州虎牙科技有限公司 Application process monitoring method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7587718B1 (en) * 2008-10-31 2009-09-08 Synopsys, Inc. Method and apparatus for enforcing a resource-usage policy in a compute farm
CN103412793A (en) * 2013-07-29 2013-11-27 北京奇虎科技有限公司 Method, device and system for optimizing system resources
CN104133757A (en) * 2013-11-28 2014-11-05 腾讯科技(成都)有限公司 Method for obtaining memory information and terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7587718B1 (en) * 2008-10-31 2009-09-08 Synopsys, Inc. Method and apparatus for enforcing a resource-usage policy in a compute farm
CN103412793A (en) * 2013-07-29 2013-11-27 北京奇虎科技有限公司 Method, device and system for optimizing system resources
CN104133757A (en) * 2013-11-28 2014-11-05 腾讯科技(成都)有限公司 Method for obtaining memory information and terminal

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106781094A (en) * 2016-12-29 2017-05-31 北京安天网络安全技术有限公司 A kind of ATM system resource exception warning system and method
CN107179950A (en) * 2017-06-29 2017-09-19 努比亚技术有限公司 A kind of application process processing method, mobile terminal and computer-readable recording medium
CN107463642A (en) * 2017-07-19 2017-12-12 北京京东尚科信息技术有限公司 The method and apparatus for lifting Tool for Data Warehouse resource utilization
CN109412884A (en) * 2018-08-21 2019-03-01 平安科技(深圳)有限公司 Performance data acquisition method, device and storage medium, the server of component
CN109982144A (en) * 2019-03-12 2019-07-05 四川长虹电器股份有限公司 Monitor and judge the automated testing method that application process CPU occupies superelevation and alarms
CN109982144B (en) * 2019-03-12 2020-06-30 四川长虹电器股份有限公司 Automatic testing method for monitoring and judging CPU occupancy of application process and alarming
CN111131815A (en) * 2019-12-18 2020-05-08 苏宁智能终端有限公司 Smart television performance monitoring and abnormal process processing method and device
CN111258847A (en) * 2020-01-13 2020-06-09 北京字节跳动网络技术有限公司 File handle monitoring and analyzing method, device, medium and equipment
CN111258847B (en) * 2020-01-13 2023-08-22 北京字节跳动网络技术有限公司 File handle monitoring and analyzing method, device, medium and equipment
CN111274060A (en) * 2020-02-10 2020-06-12 广州虎牙科技有限公司 Method, device, equipment and storage medium for determining memory abnormity
CN113032207A (en) * 2021-03-02 2021-06-25 广州虎牙科技有限公司 Application process monitoring method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105808412A (en) Process resource real-time monitoring method
US9268663B1 (en) Software testing analysis and control
CN108521339B (en) Feedback type node fault processing method and system based on cluster log
US9639446B2 (en) Trace monitoring
CN106708700B (en) A kind of O&M monitoring method and device applied to server-side
US20100211754A1 (en) Memory utilization analysis
CN106156355B (en) Log processing method and device
CN103019942B (en) Method and system for automatically testing applications to be tested based on android system
CN104834601B (en) The automated testing method of intelligent terminal RAM leakage based on android system
US9836298B2 (en) Deployment rule system
CN102163161A (en) Process management method and device thereof
CN104820640A (en) Webpage testing method and device
CN107766219A (en) Automated testing log collection method, system, equipment and computer memory device
CN107066370A (en) A kind of automatic monitoring and the instrument and method for collecting faulty hard disk daily record
CN108632111A (en) Service link monitoring method based on log
CN103903312B (en) The execution method and apparatus of automatic detecting
CN108108296A (en) A kind of cloud test method, server and client
CN111382023A (en) Code fault positioning method, device, equipment and storage medium
CN105740142A (en) Pressure test management system for SSR (Server Security Reinforcement) centralized management platform
CN104317857A (en) House information acquisition service system
CN105069029B (en) A kind of real-time ETL system and method
CN105183629A (en) Diagnosis system and diagnosis method for analyzing performance of PHP application software, and performance management platform thereof
Šor et al. Memory leak detection in Plumbr
CN108039956A (en) Using monitoring method, system and computer-readable recording medium
CN106899436A (en) A kind of cloud platform failure predication diagnostic system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160727