# Why does AMPL appear to “hang” for a long time without accepting any input or producing any output?

**URL:** <https://discuss.ampl.com/t/why-does-ampl-appear-to-hang-for-a-long-time-without-accepting-any-input-or-producing-any-output/67>\
**Category:** FAQs\
**Tags:** errors-and-messages\
**Created:** [December 15, 2021, 5:54pm UTC](https://discuss.ampl.com/t/why-does-ampl-appear-to-hang-for-a-long-time-without-accepting-any-input-or-producing-any-output/67 "2021-12-15T17:54:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![megrobert](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@megrobert](https://discuss.ampl.com/u/megrobert)\
**Post date:** [December 15, 2021, 5:54pm UTC](https://discuss.ampl.com/t/why-does-ampl-appear-to-hang-for-a-long-time-without-accepting-any-input-or-producing-any-output/67/1 "2021-12-15T17:54:28Z")

</div>

If AMPL appears to hang after a `solve` command but before any output from a solver, then it may be taking much more time to generate your problem than you expected. Try setting `option times 1, gentimes 1` to get more output recording AMPL’s progress, as explained in the FAQ question regarding [insufficient memory](https://ampl.com/resources/faqs/#qa-faq18).

The same advice applies if AMPL hangs after some other command, such as `write` or `expand` , that forces a lot of variables or constraints to be generated.

If AMPL appears to hang after a command that produces a listing, such as `display` , then the listing may be much longer than you expected. Usually it is possible to make a quick estimate of the size of the listing, in order to determine whether this could be the difficulty.

If AMPL appears to hang after a line or more from the solver, then your optimization problem may be taking much more time to solve than you expected. Try setting solver directives that provide more output recording progress toward an optimum. Some solvers may also respond to a “break” sequence (such as Ctrl-C) by returning the best solution found so far. These features differ from one solver to the next and even from one algorithm to the next within the same solver; see the [solver-specific documentation](https://ampl.com/products/solvers/) for details.
