日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux x64 下 Matlab R2013a 300 kb 脚本文件调试的 CPU 占用过高问题的解决办法

發(fā)布時間:2024/4/13 linux 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux x64 下 Matlab R2013a 300 kb 脚本文件调试的 CPU 占用过高问题的解决办法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

(1) 系統(tǒng)+軟件版本

???? CentOS 6.5 (Final), 64 位,內(nèi)核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) 問題描述

???? 通常在這個環(huán)境下,小文件的代碼都可以調(diào)試通過.

???? 最近,把所有函數(shù)集合到一個M文件(332.4 kb),只是簡單地設(shè)置了幾個斷點, 運行到斷點位置再停止運行, cpu和內(nèi)存占用都還算正常.

???? 但接下來對m文件的編輯就開始變得非常慢, 甚至是只添加幾個單詞就會卡住, 一直沒有響應, 內(nèi)存占用不變, 而1/4核CPU的占用高達100%, 只能從系統(tǒng)監(jiān)視器里殺死進程.?

???? 我猜想, Matlab對M文件大小的支持,是不是非常有限? 子函數(shù)版本太多也是罪過,想著集成起來可以方便調(diào)用和標注,沒想到弄巧成拙了...

?

(3) 解決辦法

找到兩個解決辦法.

一是使用 '-singleCompThread' 參數(shù)啟動matlab. 親測可用. 調(diào)試編輯都和原來基本一樣, 不再卡頓了. 這要感謝水木網(wǎng)友 @RSVP 的耐心解答.

[usr@usr ~]$ matlab -helpUsage: 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 diagnosticinformation. MATLAB is not run.-e - Display ALL the environment variables andtheir values to standard output. MATLABis not run. If the exit status is not0 on return then the variables and valuesmay not be correct.-arch - Start MATLAB assuming architecture arch.v=variant - Start the version of MATLAB foundin bin/glnxa64/variant instead of bin/glnxa64.v=arch/variant - Start the version of MATLAB foundin bin/arch/variant instead of bin/glnxa64.-c licensefile - Set location of the license file that MATLABshould use. It can have the form port@host orbe a colon separated list of license files.The LM_LICENSE_FILE and MLM_LICENSE_FILEenvironment variables will be ignored.-display Xdisplay - Send X commands to X server display, Xdisplay.-nodisplay - Do not display any X commands. The MATLABdesktop will not be started. However, unless-nojvm is also provided the Java virtual machinewill be started.-nosplash - Do not display the splash screen during startup.-mwvisual visualid - The default X visual to use for figure windows.-debug - Provide debugging information especially for Xbased problems.-desktop - Allow the MATLAB desktop to be started by aprocess without a controlling terminal. This isusually a required command line argument whenattempting to start MATLAB from a window managermenu or desktop icon.-nodesktop - Do not start the MATLAB desktop. Use the currentterminal for commands. The Java virtual machinewill be started.-singleCompThread - Limit MATLAB to a single computational thread. By default, MATLAB makes use of the multithreading capabilities of the computer on which it is running.-nojvm - Shut off all Java support by not starting theJava virtual machine. In particular the MATLABdesktop will not be started.-jdb [port] - Enable remote Java debugging on port (default 4444)-r MATLAB_command - Start MATLAB and execute the MATLAB_command.-logfile log - Make a copy of any output to the command windowin file log. This includes all crash reports.-Ddebugger [options] - Start debugger to debug MATLAB.-nouserjavapath - Ignore custom javaclasspath.txt and javalibrarypath.txt files.

?

二是使用外部編輯器 Emacs 來編輯和調(diào)試. 調(diào)試采用 matlab-shell mode, 稍微復雜一些, 傳統(tǒng)的快捷鍵都不怎么能用, 只能用命令設(shè)置斷點和運行, 涉及到的命令有: dbstop & dbstatus & dbcont & dbquit 等, 可參閱這篇博客<MATLAB的簡單debug功能>. 在調(diào)試過程中編輯腳本也沒問題, matlab 占用也小. 有關(guān) Emacs 多窗口之間切換的快捷鍵可以參考 學習Emacs系列教程(十):多窗口.

?

全文完.

?

轉(zhuǎn)載于:https://www.cnblogs.com/snake553/p/5357808.html

總結(jié)

以上是生活随笔為你收集整理的Linux x64 下 Matlab R2013a 300 kb 脚本文件调试的 CPU 占用过高问题的解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。