unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs and nxml/nxhtml-mode: memory overflow
@ 2012-08-23 12:56 Martin Butz
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Butz @ 2012-08-23 12:56 UTC (permalink / raw)
  To: Help-gnu-emacs

Hi,

since a few weeks I have some serious problem, while using emacs for 
webdevelopement. I use (and would like to in future) nxhtml-mode. It 
seems that this mode (or the underlying nxml-mode) causes emacs to 
consume 100 % cpu-power - at least after a while. I can not spotify the 
exact reason for this; in some cases it seem to be caused be validation. 
Emacs says MEM FULL! (mode line), freezes and there's no other way as to 
kill the process.

I setup a separate .emacs-webdev to use emacs for webdevelopement 
without allmost any of my extensions/configuration, which I usually use. 
This did work for a while, but as I had a crash today, it seems, that it 
can happen anytime.

There might be some side effects concerning one or the other extension 
but I have no clue how I can find out whats going on. It could also be 
caused by some bug in nxhml/nxhtml-mode but I can not find any 
information on the web, which seems to backup this.

I already filed a bug report at launchpad (which admittedly is based on 
a very poor information base, as I do not know how to securely reproduce 
the misbehaviour); also my posting at stackoverflow [2] was not crowned 
with success.

Currently I use emacs 23.2.1 on Linux Mint 11. The last version of 
nxml-mode I used is 20041004.

Any tips about that? How can I possibly find out, what emacs causes to 
do that?

Greetings
Martin

[1] <https://bugs.launchpad.net/nxhtml/+bug/1032564>
[2] 
<http://stackoverflow.com/questions/11247666/emacs-nxhtml-mode-memory-full>
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| G. Martin Butz, mb@mkblog.org, 0421 98749324, www.mkblog.org |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
@ 2012-08-26 14:35 Dmitry Gutov
  2012-08-26 16:01 ` Jambunathan K
  2012-08-26 19:02 ` Martin Butz
  0 siblings, 2 replies; 12+ messages in thread
From: Dmitry Gutov @ 2012-08-26 14:35 UTC (permalink / raw)
  To: mb; +Cc: Help-gnu-emacs

Hi Martin,

Martin Butz <mb@mkblog.org> writes:
 > since a few weeks I have some serious problem, while using emacs for
 > webdevelopement. I use (and would like to in future) nxhtml-mode. It 
seems that
 > this mode (or the underlying nxml-mode) causes emacs to consume 100 % 
cpu-power
 > - at least after a while. I can not spotify the exact reason for 
this; in some
 > cases it seem to be caused be validation. Emacs says MEM FULL! (mode 
line),
 > freezes and there's no other way as to kill the process.
 > ...

I can't help you with nxhtml-mode, but if you describe what exact
features from it you're using, people here might suggest some
alternatives.
nxml-mode, by the way, is considered fairly stable, so if you don't need 
anything additional, you can use it alone.

--Dmitry



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-26 14:35 Dmitry Gutov
@ 2012-08-26 16:01 ` Jambunathan K
  2012-08-26 19:07   ` Martin Butz
  2012-08-26 19:02 ` Martin Butz
  1 sibling, 1 reply; 12+ messages in thread
From: Jambunathan K @ 2012-08-26 16:01 UTC (permalink / raw)
  To: mb; +Cc: Help-gnu-emacs

Dmitry Gutov <dgutov@yandex.ru> writes:

>> since a few weeks I have some serious problem, while using emacs for
>> webdevelopement. I use (and would like to in future) nxhtml-mode. It 
> seems that
>> this mode (or the underlying nxml-mode) causes emacs to consume 100
>> % 
> cpu-power
>> - at least after a while. I can not spotify the exact reason for 
> this; in some
>> cases it seem to be caused be validation. Emacs says MEM FULL! (mode 
> line),
>> freezes and there's no other way as to kill the process.
>> ...

Have you tried disabling validation.  

If your XML file has no newlines then Emacs will choke.

IIRC, validation happens under the control of timer.  Try increasing it.
-- 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-26 14:35 Dmitry Gutov
  2012-08-26 16:01 ` Jambunathan K
@ 2012-08-26 19:02 ` Martin Butz
  1 sibling, 0 replies; 12+ messages in thread
From: Martin Butz @ 2012-08-26 19:02 UTC (permalink / raw)
  Cc: Help-gnu-emacs

Am 26.08.2012 16:35, schrieb Dmitry Gutov:
> Hi Martin,

[...]

> I can't help you with nxhtml-mode, but if you describe what exact
> features from it you're using, people here might suggest some
> alternatives.

Mostly I am working with xhtml mixed with php, and css-mode. I found 
that the indentation is the best of all modes, especially when working 
with xhtml with php chunks. I offen use the option to find/mark matching 
elements.

> nxml-mode, by the way, is considered fairly stable, so if you don't need
> anything additional, you can use it alone.

well yes, that's what I did. It seemed to work, although I started to 
add some modes/extensions I offen use, such as anything and elscreen as 
well as the stuff lots of people have in their dot-emacs (matching 
parentheses aso.). At some point I again had this strange memory 
overflow. I admit, I haven't had the patience to find out, whether it is 
nxhtml crashes itself at some point or this is a side effect of nxhtml 
and some other mode. As I said, I am not able to reprocuce it 
consistantly. I only have the assumption, that it takes some time until 
the crash occurs.

Thanks a lot for the input.

Martin

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| G. Martin Butz, mb@mkblog.org, 0421 98749324, www.mkblog.org |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-26 16:01 ` Jambunathan K
@ 2012-08-26 19:07   ` Martin Butz
  2012-08-26 19:18     ` Jambunathan K
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Butz @ 2012-08-26 19:07 UTC (permalink / raw)
  To: Help-gnu-emacs

Am 26.08.2012 18:01, schrieb Jambunathan K:
> >> since a few weeks I have some serious problem, while using emacs for
>>> webdevelopement. I use (and would like to in future) nxhtml-mode. It
>> seems that
>>> this mode (or the underlying nxml-mode) causes emacs to consume 100
>>> %
>> cpu-power
>>> - at least after a while. I can not spotify the exact reason for
>> this; in some
>>> cases it seem to be caused be validation. Emacs says MEM FULL! (mode
>> line),
>>> freezes and there's no other way as to kill the process.
>>> ...
>
> Have you tried disabling validation.

I tried to do that over the menu, but did not find the responsible 
variable to disable it completely.

> If your XML file has no newlines then Emacs will choke.

This is to say: at the EOF?

> IIRC, validation happens under the control of timer.  Try increasing it.

Do you know, how to do this? I assume, it is a variable of nxml-mode, right?

Thanks
Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| G. Martin Butz, mb@mkblog.org, 0421 98749324, www.mkblog.org |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-26 19:07   ` Martin Butz
@ 2012-08-26 19:18     ` Jambunathan K
  2012-08-27  9:37       ` Richard Riley
  2012-08-27 18:44       ` Martin Butz
  0 siblings, 2 replies; 12+ messages in thread
From: Jambunathan K @ 2012-08-26 19:18 UTC (permalink / raw)
  To: mb; +Cc: Help-gnu-emacs

Martin Butz <mb@mkblog.org> writes:

> Am 26.08.2012 18:01, schrieb Jambunathan K:
>> >> since a few weeks I have some serious problem, while using emacs for
>>>> webdevelopement. I use (and would like to in future) nxhtml-mode. It
>>> seems that
>>>> this mode (or the underlying nxml-mode) causes emacs to consume 100
>>>> %
>>> cpu-power
>>>> - at least after a while. I can not spotify the exact reason for
>>> this; in some
>>>> cases it seem to be caused be validation. Emacs says MEM FULL! (mode
>>> line),
>>>> freezes and there's no other way as to kill the process.
>>>> ...
>>
>> Have you tried disabling validation.
>
> I tried to do that over the menu, but did not find the responsible
> variable to disable it completely.

M-x apropos-variable RET validate RET

,----
| Type RET on an entry to view its full documentation.
| 
| rng-nxml-auto-validate-flag
|    Non-nil means automatically turn on validation with nxml-mode.
| rng-validate-chunk-size
|    Number of characters in a RELAX NG validation chunk.
| rng-validate-delay
|    Time in seconds that Emacs must be idle before starting a full
|    validation.
| rng-validate-quick-delay
|    Time in seconds that Emacs must be idle before starting a quick
|    validation.
`----

>> If your XML file has no newlines then Emacs will choke.
>
> This is to say: at the EOF?

I mean long lines - something like this

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

instead of like this

aaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaa

>> IIRC, validation happens under the control of timer.  Try increasing it.
>
> Do you know, how to do this? I assume, it is a variable of nxml-mode, right?

See above options.

ps: I haven't used nxhtml-mode

> Thanks
> Martin

-- 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
@ 2012-08-26 20:19 Dmitry Gutov
  2012-08-27  9:38 ` Richard Riley
  0 siblings, 1 reply; 12+ messages in thread
From: Dmitry Gutov @ 2012-08-26 20:19 UTC (permalink / raw)
  To: mb; +Cc: Help-gnu-emacs

Martin Butz <mb@mkblog.org> writes:
 > Am 26.08.2012 18:01, schrieb Jambunathan K:
 >> Have you tried disabling validation.
 >
 > I tried to do that over the menu, but did not find the responsible 
variable to
 > disable it completely.

If you're going to disable validation, you might want to look into just
using html-mode instead of nxml-mode. It has commands for moving to
matching tags, too:

http://stackoverflow.com/questions/7022556/emacs-nxhtml-how-to-highlight-or-jump-to-the-closing-html-tag

IIRC nxhtml should also have a multi-mode for PHP that is based on
html-mode.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-26 19:18     ` Jambunathan K
@ 2012-08-27  9:37       ` Richard Riley
  2012-08-27 18:44       ` Martin Butz
  1 sibling, 0 replies; 12+ messages in thread
From: Richard Riley @ 2012-08-27  9:37 UTC (permalink / raw)
  To: help-gnu-emacs

Jambunathan K <kjambunathan@gmail.com> writes:

> Martin Butz <mb@mkblog.org> writes:
>
>> Am 26.08.2012 18:01, schrieb Jambunathan K:
>>> >> since a few weeks I have some serious problem, while using emacs for
>>>>> webdevelopement. I use (and would like to in future) nxhtml-mode. It
>>>> seems that
>>>>> this mode (or the underlying nxml-mode) causes emacs to consume 100
>>>>> %
>>>> cpu-power
>>>>> - at least after a while. I can not spotify the exact reason for
>>>> this; in some
>>>>> cases it seem to be caused be validation. Emacs says MEM FULL! (mode
>>>> line),
>>>>> freezes and there's no other way as to kill the process.
>>>>> ...
>>>
>>> Have you tried disabling validation.
>>
>> I tried to do that over the menu, but did not find the responsible
>> variable to disable it completely.
>
> M-x apropos-variable RET validate RET
>
> ,----
> | Type RET on an entry to view its full documentation.
> | 
> | rng-nxml-auto-validate-flag
> |    Non-nil means automatically turn on validation with nxml-mode.
> | rng-validate-chunk-size
> |    Number of characters in a RELAX NG validation chunk.
> | rng-validate-delay
> |    Time in seconds that Emacs must be idle before starting a full
> |    validation.
> | rng-validate-quick-delay
> |    Time in seconds that Emacs must be idle before starting a quick
> |    validation.
> `----
>
>>> If your XML file has no newlines then Emacs will choke.
>>
>> This is to say: at the EOF?
>
> I mean long lines - something like this
>
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
>
> instead of like this
>
> aaaaaaaaaaaaaaaaaaaaaa
> aaaaaaaaaaaaaaaaaaaaaa
> aaaaaaaaaaaaaaaaaaaaaa
> aaaaaaaaaaaaaaaaaaaaaa
>
>>> IIRC, validation happens under the control of timer.  Try increasing it.
>>
>> Do you know, how to do this? I assume, it is a variable of nxml-mode, right?
>
> See above options.
>
> ps: I haven't used nxhtml-mode

I've tried most methods for mixed mode.

nxhtml is really the only mode for mixed mode programming that even
begins to be useful. I tend to find most other recommendations are done
by people who are not using mixed mode at all. Regradless how the
purists see mixed mode files (try mentioning PHP even in #emacs) , they
are very common. php and html/css/javascript in one file is not
unusual. Emacs addressing this "natively" would be a real boon.

Unfortunately nxhrml doesnt seem to be maintained anymore, or?
Certainly in trunk emacs 24 using nxthml produces loads of popup error
buffers. I emailed the author but got no response.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-26 20:19 Emacs and nxml/nxhtml-mode: memory overflow Dmitry Gutov
@ 2012-08-27  9:38 ` Richard Riley
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Riley @ 2012-08-27  9:38 UTC (permalink / raw)
  To: help-gnu-emacs

Dmitry Gutov <dgutov@yandex.ru> writes:

> Martin Butz <mb@mkblog.org> writes:
>> Am 26.08.2012 18:01, schrieb Jambunathan K:
>>> Have you tried disabling validation.
>>
>> I tried to do that over the menu, but did not find the responsible 
> variable to
>> disable it completely.
>
> If you're going to disable validation, you might want to look into just
> using html-mode instead of nxml-mode. It has commands for moving to
> matching tags, too:

html-mode is useless, give or take, for mixed mode files.

>
> http://stackoverflow.com/questions/7022556/emacs-nxhtml-how-to-highlight-or-jump-to-the-closing-html-tag
>
> IIRC nxhtml should also have a multi-mode for PHP that is based on
> html-mode.

nxhtml ships with its own php mode and is one of the main reasons for
its development from what I can gather. It has come along a long way and
is very useful when it works properly.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-26 19:18     ` Jambunathan K
  2012-08-27  9:37       ` Richard Riley
@ 2012-08-27 18:44       ` Martin Butz
  2012-08-27 20:11         ` Martin Butz
  1 sibling, 1 reply; 12+ messages in thread
From: Martin Butz @ 2012-08-27 18:44 UTC (permalink / raw)
  To: Help-gnu-emacs

Hi Jambinathan,

Am 26.08.2012 21:18, schrieb Jambunathan K:
> M-x apropos-variable RET validate RET
>
> ,----
> | Type RET on an entry to view its full documentation.
> |
> | rng-nxml-auto-validate-flag
> |    Non-nil means automatically turn on validation with nxml-mode.
> | rng-validate-chunk-size
> |    Number of characters in a RELAX NG validation chunk.
> | rng-validate-delay
> |    Time in seconds that Emacs must be idle before starting a full
> |    validation.
> | rng-validate-quick-delay
> |    Time in seconds that Emacs must be idle before starting a quick
> |    validation.
> `----

Thanks. I'll give it a try.

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| G. Martin Butz, mb@mkblog.org, 0421 98749324, www.mkblog.org |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
@ 2012-08-27 18:55 Dmitry Gutov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Gutov @ 2012-08-27 18:55 UTC (permalink / raw)
  To: Richard Riley; +Cc: help-gnu-emacs

Richard Riley <rileyrg@gmail.com> writes:
 > I've tried most methods for mixed mode.
 >
 > nxhtml is really the only mode for mixed mode programming that even
 > begins to be useful. I tend to find most other recommendations are done
 > by people who are not using mixed mode at all. Regradless how the
 > purists see mixed mode files (try mentioning PHP even in #emacs) , they
 > are very common. php and html/css/javascript in one file is not
 > unusual. Emacs addressing this "natively" would be a real boon.
 >
 > Unfortunately nxhrml doesnt seem to be maintained anymore, or?
 > Certainly in trunk emacs 24 using nxthml produces loads of popup error
 > buffers. I emailed the author but got no response.

If you were using ERB (with Rails) or EJS, I'd have another suggestion,
but for PHP you can try web-mode [1] that was announced on one of the 
mailing lists here a few weeks ago.
I've no idea about its quality, but at least it's still being developed.

[1] http://web-mode.org/

--Dmitry



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Emacs and nxml/nxhtml-mode: memory overflow
  2012-08-27 18:44       ` Martin Butz
@ 2012-08-27 20:11         ` Martin Butz
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Butz @ 2012-08-27 20:11 UTC (permalink / raw)
  To: Help-gnu-emacs

I am sorry. The mailserver I am using seems to have a hickup....

Martin

Am 27.08.2012 20:44, schrieb Martin Butz:
> Hi Jambinathan,
>
> Am 26.08.2012 21:18, schrieb Jambunathan K:
>> M-x apropos-variable RET validate RET
>>
>> ,----
>> | Type RET on an entry to view its full documentation.
>> |
>> | rng-nxml-auto-validate-flag
>> |    Non-nil means automatically turn on validation with nxml-mode.
>> | rng-validate-chunk-size
>> |    Number of characters in a RELAX NG validation chunk.
>> | rng-validate-delay
>> |    Time in seconds that Emacs must be idle before starting a full
>> |    validation.
>> | rng-validate-quick-delay
>> |    Time in seconds that Emacs must be idle before starting a quick
>> |    validation.
>> `----
>
> Thanks. I'll give it a try.
>
> Martin


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| G. Martin Butz, mb@mkblog.org, 0421 98749324, www.mkblog.org |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-08-27 20:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-26 20:19 Emacs and nxml/nxhtml-mode: memory overflow Dmitry Gutov
2012-08-27  9:38 ` Richard Riley
  -- strict thread matches above, loose matches on Subject: below --
2012-08-27 18:55 Dmitry Gutov
2012-08-26 14:35 Dmitry Gutov
2012-08-26 16:01 ` Jambunathan K
2012-08-26 19:07   ` Martin Butz
2012-08-26 19:18     ` Jambunathan K
2012-08-27  9:37       ` Richard Riley
2012-08-27 18:44       ` Martin Butz
2012-08-27 20:11         ` Martin Butz
2012-08-26 19:02 ` Martin Butz
2012-08-23 12:56 Martin Butz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).