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

时间:2022-09-18 14:05:36

(1) 系统+软件版本

CentOS 6.5 (Final), 64 位,内核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) 问题描述

通常在这个环境下,小文件的代码都可以调试通过.

最近,把所有函数集合到一个M文件(332.4 kb),只是简单地设置了几个断点, 运行到断点位置再停止运行, cpu和内存占用都还算正常.

但接下来对m文件的编辑就开始变得非常慢, 甚至是只添加几个单词就会卡住, 一直没有响应, 内存占用不变, 而1/4核CPU的占用高达100%, 只能从系统监视器里杀死进程.

我猜想, Matlab对M文件大小的支持,是不是非常有限? 子函数版本太多也是罪过,想着集成起来可以方便调用和标注,没想到弄巧成拙了...

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

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

(3) 解决办法

找到两个解决办法.

一是使用 '-singleCompThread' 参数启动matlab. 亲测可用. 调试编辑都和原来基本一样, 不再卡顿了. 这要感谢水木网友 @RSVP 的耐心解答.

[usr@usr ~]$ 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 not
on return then the variables and values
may not be correct.
-arch - Start MATLAB assuming architecture arch.
v=variant - Start the version of MATLAB found
in bin/glnxa64/variant instead of bin/glnxa64.
v=arch/variant - Start the version of MATLAB found
in bin/arch/variant instead of bin/glnxa64.
-c licensefile - Set location of the license file that MATLAB
should use. It can have the form port@host or
be a colon separated list of license files.
The LM_LICENSE_FILE and MLM_LICENSE_FILE
environment variables will be ignored.
-display Xdisplay - Send X commands to X server display, Xdisplay.
-nodisplay - Do not display any X commands. The MATLAB
desktop will not be started. However, unless
-nojvm is also provided the Java virtual machine
will 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 X
based problems.
-desktop - Allow the MATLAB desktop to be started by a
process without a controlling terminal. This is
usually a required command line argument when
attempting to start MATLAB from a window manager
menu or desktop icon.
-nodesktop - Do not start the MATLAB desktop. Use the current
terminal for commands. The Java virtual machine
will 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 the
Java virtual machine. In particular the MATLAB
desktop will not be started.
-jdb [port] - Enable remote Java debugging on port (default )
-r MATLAB_command - Start MATLAB and execute the MATLAB_command.
-logfile log - Make a copy of any output to the command window
in file log. This includes all crash reports.
-Ddebugger [options] - Start debugger to debug MATLAB.
-nouserjavapath - Ignore custom javaclasspath.txt and javalibrarypath.txt files.

二是使用外部编辑器 Emacs 来编辑和调试. 调试采用 matlab-shell mode, 稍微复杂一些, 传统的快捷键都不怎么能用, 只能用命令设置断点和运行, 涉及到的命令有: dbstop & dbstatus & dbcont & dbquit 等, 可参阅这篇博客<MATLAB的简单debug功能>. 在调试过程中编辑脚本也没问题, matlab 占用也小. 有关 Emacs 多窗口之间切换的快捷键可以参考 学习Emacs系列教程(十):多窗口.

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

全文完.

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

  1. linux系统下重启tomcat的shell脚本

    linux系统下重启tomcat的shell脚本: #!/bin/shtomcat_home=/opt/apache-tomcat- #找到tomcat进程的id并kill掉 ps -ef |grep ...

  2. Linux环境下段错误的产生原因及调试方法小结(转)

    最近在Linux环境下做C语言项目,由于是在一个原有项目基础之上进行二次开发,而且 项目工程庞大复杂,出现了不少问题,其中遇到最多.花费时间最长的问题就是著名的“段错误”(Segmentation F ...

  3. Linux环境下段错误的产生原因及调试方法小结

    转载自http://www.cnblogs.com/panfeng412/archive/2011/11/06/2237857.html 最近在Linux环境下做C语言项目,由于是在一个原有项目基础之 ...

  4. Linux环境下段错误的产生原因及调试方法小结【转】

    转自:http://www.cnblogs.com/panfeng412/archive/2011/11/06/2237857.html 最近在Linux环境下做C语言项目,由于是在一个原有项目基础之 ...

  5. 转:Linux环境下段错误的产生原因及调试方法小结

    源地址:http://www.cnblogs.com/panfeng412/archive/2011/11/06/2237857.html 补充:http://baike.baidu.com/link ...

  6. 【转】解决ubuntu13&period;10下,无法双击运行脚本文件

    解决ubuntu13.10下,无法双击运行脚本文件 转自:http://www.aichengxu.com/other/975350.htm    首先,必须先设定好脚本的运行方法,当然如果只是she ...

  7. Linux系统下 MYSQL数据库中的数据库文件在本机内迁移 (需暂停服务的方式)

    Linux系统下 MYSQL数据库中的数据库文件在本机内迁移 本机采用Ubuntu16.04系统,tar方式安装MySQL5.7.21 数据库安装文件夹为    /home/devil/mysql 现 ...

  8. Linux kswapd0 进程CPU占用过高

    图便宜买了个1核1G虚拟机,启动两个jar后cpu飙升直接卡死,查看cpu及内存占用 发现kswapd0进程cpu占用一直居高不下,于是查询资料,总结如下. swap分区的作用是当物理内存不足时,会将 ...

  9. linux&lpar;x64&rpar;下安装Matlab 2015b破解版(含安装包)

    注意:在安装前请查看安装目录是否有足够空间!完全安装大概需要12G的空间!本人在安装后系统盘满了,导致无法启动图形界面.小伙伴们不要重蹈覆辙~ Environment Linux debian8 (x ...

随机推荐

  1. XAF学习笔记1

    写软件很多年了.看过的框架用过的框架非常多.一直想要一种框架,说不出的心烦重复的数据库设计,重复的Model生成,重复的界面设计 一直寻寻觅觅,终于找到一个框架,DEV的XAF,DEV控件用了N年了, ...

  2. js将日期格式转换为YYYY-MM-DD HH&colon;MM&colon;SS

    <script language="javascript" type="text/javascript"> //页面加载 jQuery(docume ...

  3. 课堂所讲整理:输入输出流(I&sol;O)

    package org.hanqi.ex; import java.io.*; public class TestFile { public static void main(String[] arg ...

  4. lightOJ 1030&lpar;期望&rpar;

    题意:有一个迷宫是1×n的格子,一个人每到一个格子就能够把这个格子内的金子所有拿走,刚開始站在第1个格子,然后開始掷骰子得到点数x,他就要从当前位置走到加x的位置.假设发现位置是大于n的就又一次掷骰子 ...

  5. session在登录中的使用

    package action.exam; import java.util.Map; import com.opensymphony.xwork2.ActionContext; import com. ...

  6. 《Programming WPF》翻译 第6章 3&period;二进制资源

    原文:<Programming WPF>翻译 第6章 3.二进制资源 尽管ResourceDictionary和系统级别的资源适合于作为数据存在于对象中,然而,并不是所有的资源都能很好的满 ...

  7. 爬虫新手学习2-爬虫进阶&lpar;urllib和urllib2 的区别、url转码、爬虫GET提交实例、批量爬取贴吧数据、fidder软件安装、有道翻译POST实例、豆瓣ajax数据获取&rpar;

    1.urllib和urllib2区别实例 urllib和urllib2都是接受URL请求相关模块,但是提供了不同的功能,两个最显著的不同如下: urllib可以接受URL,不能创建设置headers的 ...

  8. 浙江省赛 C What Kind of Friends Are You&quest;

    思路:一开始考虑n个朋友可以有c种可能,根据回答的问题,如果是yes那么可以确定一些朋友的范围,将原本不在这个范围内的删除即可:如果是"no",说明这些朋友都应该被删除,那么最后看 ...

  9. Docker-服务(4)

    服务定义 在分布式应用程序中,应用程序的不同部分称为“服务”.例如,如果您想象一个视频共享站点,它可能包括一个用于在数据库中存储应用程序数据的服务,一个用户在上传内容后在后台进行视频转码的服务,一个用 ...

  10. tzhpxc

    #include<bits/stdc++.h> using namespace std; int nxt[200100],las[200100],ct,va[200010],pos[410 ...