The solution to the high CPU consumption problem of Matlab r2013a KB script file debugging under Linux x64

Source: Internet
Author: User

(1) system + software version

CentOS 6.5 (Final), 64-bit, kernel initramfs-2.6.32-431.5.1.el6.x86_64,

MATLAB version:8.1.0.604 (r2013a)
Java 1.6.0_17-B04 with Sun Microsystems Inc. Java HotSpot (TM) 64-bit Server VM Mixed mode

(2) Description of the problem

Usually in this environment, the code of the small file can be debugged.

Recently, the collection of all functions into an M file (332.4 KB), simply set a few breakpoints, run to the breakpoint location and then stop running, CPU and memory consumption is normal.

But then the editing of M file began to become very slow, even just add a few words will be stuck, no response, memory consumption, and 1/4 cores CPU occupied up to 100%, only from the System Monitor to kill the process.

I guess, MATLAB support for m file size is not very limited? Sub-function version too many is also a sin, think integration can be convenient to call and labeling, did not think self-defeating ...

(3) Workaround

Two solutions found.

One is to use the '-singlecompthread ' parameter to start MATLAB. The pro-test is available. Debugging and editing are basically the same as the original, no longer kaka. This is to thank the water wood netizen @RSVP patient answer.

[email protected] ~]$ matlab-Help Usage:matlab [-H|-HELP] | [-N |-e] [-arch | V=variant | v=arch/Variant] [-C LicenseFile] [-display xdisplay |Nodisplay] [-nosplash] [-mwvisual visualid] [-debug] [-Softwareopengl] [-desktop | -nodesktop | -NOJVM] [-R Matlab_command] [-logfile log] [-Ddebugger [options]]-h|-help-Display arguments. -N-Display Final environment variables, arguments, and other diagnostic Information.    MATLAB is not run. -E-Display all the environment variables and their values to standard output. MATLAB is not run. If The exit status is not0On return ThenThe variables and values may is not correct. -arch-Start MATLAB Assuming architecture arch. V=variant-Start The version of MATLAB foundinchBin/glnxa64/variant instead of bin/Glnxa64. V=arch/variant-Start The version of MATLAB foundinchBin/arch/variant instead of bin/Glnxa64. -C Licensefile-set location of the licensefileThat's MATLAB should use.                           It can has the form [email protected] or be a colon separated list of license files.     The Lm_license_file and Mlm_license_file environment variables would be ignored. -display Xdisplay-Send x commands to x server display, Xdisplay. -nodisplay-Do not display any X commands. The MATLAB desktop is not being started. However, unless-NOJVM is also provided, Java virtual machine would be started. -nosplash-Don't display the splash screen during startup. -mwvisual visualid-the default X visual to use forFigure Windows. -debug-provide Debugging information especially forX based problems. -desktop-Allow the MATLAB desktop is started by a process without a controlling terminal. This was usually a required command line argument if attempting to St    Art MATLAB from a Window manager menu or Desktop icon. -nodesktop-Do not start the MATLAB desktop. Use the current terminal forcommands.    The Java virtual machine would be started. -Singlecompthread- Limit MATLAB to a single computational thread. by default, MATLAB makes use of the multithreading capabilities of the computer on                            whichit is running. -NOJVM-Shut off all Java support is starting the Java Virtual machine.    In particular the MATLAB desktop won't be started. -JDB [Port]-Enable remote Java Debugging on port (default4444)    -R Matlab_command-Start MATLAB and execute the Matlab_command. -logfile Log-Make a copy of any output to the command windowinch filelog.    This includes all crash reports. -ddebugger [Options]-Start Debugger to debug MATLAB. -nouserjavapath-ignore custom Javaclasspath.txt and javalibrarypath.txt files.

The second is to use the external editor Emacs to edit and Debug. debugging using Matlab-shell mode, a little more complex, the traditional shortcut keys are not how to use, can only use the command to set breakpoints and run, the commands involved are: Dbstop & dbstatus & Dbcont & Dbquit, etc., can be Read this blog <matlab simple debug function;. Editing the script during debugging is also no problem, Matlab occupies a small. The shortcut keys for switching between Emacs Multiple windows can refer to the Learning Emacs Series Tutorial (10): Multiple windows.

Complete the full text.

The solution to the high CPU consumption problem of Matlab r2013a KB script file debugging under Linux x64

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.