Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] Out of memory when generating large files with Xpand
[Xpand] Out of memory when generating large files with Xpand [message #903459] Thu, 23 August 2012 17:03 Go to next message
Alexander Fried is currently offline Alexander FriedFriend
Messages: 4
Registered: December 2009
Junior Member
Hi all!

I'm currently running into problems when generating very large files with Xpand, as I run out of memory. Unfortunately, it is not an option to just generate smaller files, as the file format and further processing is not in my hands, i.e. its just required to produce them this way.

From what I'm seeing, it seems to me that Xpand is first building up the complete file contents in memory and only after all is generated it is written out to disk. That way its clear that I'll run out of memory eventually. Is there an option to directly write the generated code to file while the script is being executed? If not, what else to do? I'd rather not switch to hardcoded println.

Thanks,
Alex

[Updated on: Thu, 23 August 2012 17:04]

Report message to a moderator

Re: [Xpand] Out of memory when generating large files with Xpand [message #903478 is a reply to message #903459] Thu, 23 August 2012 19:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6550
Registered: July 2009
Senior Member
Hi,

i dont know of an out of the box solution never the less you could split up your template to generate mutiple files (with the same name)
and configure the outlet to use append mode.

~Christian
Re: [Xpand] Out of memory when generating large files with Xpand [message #903493 is a reply to message #903459] Thu, 23 August 2012 22:22 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 360
Registered: July 2009
Location: Dortmund
Senior Member

Hi Alex,

an option would be to provide an alternative implementation of org.eclipse.xpand2.output.Output that does the job for you. This can be set to the Generator class.

Kind regards,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [Xpand] Out of memory when generating large files with Xpand [message #903844 is a reply to message #903459] Sun, 26 August 2012 11:01 Go to previous message
Alexander Fried is currently offline Alexander FriedFriend
Messages: 4
Registered: December 2009
Junior Member
Hi Karsten and Christian,

thanks to both of you for your suggestions, I'll investigate them further.

Best regards,
Alex
Previous Topic:[Acceleo] generating input filename
Next Topic:[Acceleo] Standalone problem
Goto Forum:
  


Current Time: Sun Dec 21 10:12:48 GMT 2014

Powered by FUDForum. Page generated in 0.01708 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software