Ask Your Question
1

Performance Issues [slow/commands not working]

asked 2018-04-13 19:18:59 +0100

o6p gravatar image

I love sage and I think it's the best but I'm having some serious performance issues. Sometimes it takes like up to 15 seconds to compute trivial expressions. Most of the time, after some period of usage or invocation of specific commands (I haven't observed what causes this) the clear command becomes dysfunctional and I attach the logs:

    0 [main] python2.7 14516 child_info_fork::abort: address space needed by 'eclucve31.dll' (0x400000) is already occupied
---------------------------------------------
OSError     Traceback (most recent call last)
<ipython-input-50-b74f34915750> in <module>()
----> 1 get_ipython().magic(u'clear ')

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
2156         magic_name, _, magic_arg_s = arg_s.partition(' ')
2157         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158         return self.run_line_magic(magic_name, magic_arg_s)
2159
2160     #-------------------------------------------------------------------------

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
2077                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2078             with self.builtin_trap:
-> 2079                 result = fn(*args,**kwargs)
2080             return result
2081

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/alias.py in __call__(self, rest)
    185             cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
    186
--> 187         self.shell.system(cmd)
    188
    189 #-----------------------------------------------------------------------------

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py in system_raw(self, cmd)
2245             try:
2246                 # Use env shell instead of default /bin/sh
-> 2247                 ec = subprocess.call(cmd, shell=True, executable=executable)
2248             except KeyboardInterrupt:
2249                 # intercept control-C; a long traceback is not useful here

/opt/sagemath-8.1/local/lib/python2.7/subprocess.py in call(*popenargs, **kwargs)
    166     retcode = call(["ls", "-l"])
    167     """
--> 168     return Popen(*popenargs, **kwargs).wait()
    169
    170

/opt/sagemath-8.1/local/lib/python2.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
    388                                 p2cread, p2cwrite,
    389                                 c2pread, c2pwrite,
--> 390                                 errread, errwrite)
    391         except Exception:
    392             # Preserve original exception in case os.close raises.

/opt/sagemath-8.1/local/lib/python2.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
    915                     gc.disable()
    916                     try:
--> 917                         self.pid = os.fork()
    918                     except:
    919                         if gc_was_enabled:

OSError: [Errno 11] Resource temporarily unavailable
sage: clear
    0 [main] python2.7 20456 child_info_fork::abort: address space needed by 'eclucve31.dll' (0x400000) is already occupied
---------------------------------------------
OSError     Traceback (most recent call last)
<ipython-input-51-b74f34915750> in <module>()
----> 1 get_ipython().magic(u'clear ')

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
2156         magic_name, _, magic_arg_s = arg_s.partition(' ')
2157         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158         return self.run_line_magic(magic_name, magic_arg_s)
2159
2160     #-------------------------------------------------------------------------

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
2077                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2078             with self.builtin_trap:
-> 2079                 result = fn(*args,**kwargs)
2080             return result
2081

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/alias.py in __call__(self, rest)
    185             cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
    186
--> 187         self.shell.system(cmd)
    188
    189 #-----------------------------------------------------------------------------

/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py in system_raw(self, cmd)
2245             try:
2246                 # Use env shell instead of default /bin/sh
-> 2247                 ec = subprocess.call(cmd, shell=True, executable=executable)
2248             except KeyboardInterrupt:
2249                 # intercept control-C; a long traceback is not useful here

/opt/sagemath-8.1/local/lib/python2.7/subprocess.py in call(*popenargs, **kwargs)
    166     retcode = call(["ls", "-l"])
    167     """
--> 168     return Popen(*popenargs, **kwargs).wait()
    169
    170

/opt/sagemath-8.1/local/lib/python2.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
    388                                 p2cread, p2cwrite,
    389                                 c2pread, c2pwrite,
--> 390                                 errread, errwrite)
    391         except Exception:
    392             # Preserve original exception in case os.close raises.

/opt/sagemath-8.1/local/lib/python2.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
    915                     gc.disable()
    916                     try:
--> 917                         self.pid = os.fork()
    918                     except:
    919                         if gc_was_enabled:

OSError: [Errno 11] Resource temporarily unavailable
edit retag flag offensive close merge delete

Comments

Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2018-04-13 20:24:16 +0100 )edit

Could you add some context?

  • What is the operating system?
  • How much memory (RAM) is available on the computer?
  • How was SageMath installed?
  • Is the drive maybe almost full or is there plenty of free space on it?
  • Are there any (many?) other apps running at the same time?
  • Is this on a laptop or desktop?
  • If laptop: is this mostly when the battery is low or regardless?

Could you be more specific?

  • What computation of a trivial example takes 15 seconds?
  • What sequence of commands leads to the error in the question?
slelievre gravatar imageslelievre ( 2018-04-13 20:24:19 +0100 )edit

Such "performance" questions would probably better addressed (with the info suggested by slelievre) in the sage support mailing list, and might result in filing a ticket against (your particular version of) Sage.

Fortunately, your report has been answered to by iguananaut, which is, unless i'm mistaken, the main developer of the Windows version you seem to be using.

But keep in mind that this site is more oriented towards questions related to the use of sage in specific domains (i. e. "How do I do ... in Sage ?") rather than functionality (i. e. "Is ... a bug ?") questions...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-04-13 21:48:15 +0100 )edit

@Iguananaut I would like to thank you and let you know that it was indeed that issue that I was experiencing. I couldn't figure out what software was interfering, but rebasing cygwin solved my issue and I don't experience performance problems anymore either.

o6p gravatar imageo6p ( 2018-04-16 02:16:13 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-04-13 20:30:54 +0100

Iguananaut gravatar image

Most likely you are running Sage on Windows with some BLODA running in the background (software that interferes with Cygwin). See if you are running anything from this list (or similar applications that interfere with library address spaces, like virus scanners): https://cygwin.com/faq/faq.html#faq.u...

edit flag offensive delete link more

Comments

1

As advised by Iguananaut, I want to let you know that it was indeed BLODA that I was experiencing. I couldn't figure out what software was interfering, but rebasing cygwin solved my issue and I don't experience performance problems anymore either.

o6p gravatar imageo6p ( 2018-04-16 02:16:52 +0100 )edit

Thanks for the follow-up and I'm glad you were able to do the rebasing procedure. I think I'll figure out somewhere in the Sage docs to put information on that. Most users of Cygwin-based software don't usually have to worry about these issues, but between the size of Sage and its complexity (and use of fork throughout) DLL rebasing really is a deep issue for it (and the reason why Sage on 32-bit Cygwin can't even really work--there is simply not enough address space in 32-bits to give every module in Sage and every library on which it depends its own unique, pre-defined address space).

Iguananaut gravatar imageIguananaut ( 2018-04-28 17:38:51 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-04-13 19:18:59 +0100

Seen: 1,181 times

Last updated: Apr 16 '18