- 浏览: 548139 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
binglex:
谢谢,出现这个异常,看来这个贴才发现site-packages ...
cx_Oracle的"Unable to acquire Oracle environment handle"异常 -
lizhongkan:
这样过度比较方便。但如果原来的项目,有几十个依赖的jar包,是 ...
maven2的pom的依赖管理 -
landmine:
博文看不清呀楼主,怎么解决的?我也遇到了
applet在IE下运行极慢而且CPU占用很高 -
strivefuture:
这种方法对FF浏览器,有效吗?
Iframe Shim解决applet挡住ExtJS工具栏菜单问题 -
zw:
老大也有粗心的时候啊!
一个属性未设置导致发mail不成功的郁闷。
【翻译】Graeme答复:Groovy and JRuby: Enterprise-Ready?
- 博客分类:
- groovy/grails
有博客报道说Groovy并不适合企业,其目的只是在散播FUD(Fear, Uncertainty, Doubt)而已. 此报道如下:
http://www.huxili.com/index.php?cat=reports&id=ID000188
此报道以"Groovy and JRuby: Enterprise-Ready?"为题且得出结论是:Groovy还不适合企业仅仅是因为内存泄漏。某些人并不懂语言间习惯用法差异,而简单地放在一起进行对比,当然是无稽之谈了。
此报道并没有提供任何示例代码,更多的是通过怀疑的方式来验证其正确性,尽管如此报道还是陈述了Groovy运行在以下一些步骤的时候,会导致内存溢出:
我要猜一下他们可能用到的Groovy代码,我敢打赌这些代码应该象下面所示那样:
那么这段代码有什么问题呢?并且是怎样导致内存泄漏呢?答案很简单:每一个GroovyShell实例都有一个内部的类加载器(class
loader),而Groovy一门编译类型的语言,即便是示例中很少的一段脚本都将会被编译成类因此随着时间的流逝,类加载器将会变得越来越大。那么该
如何解决呢?请看如下代码:
这么做,JVM就会自动回收不再使用的GroovyShell (当然包括它的类加载器)了,加载器都被回收了,其旗下的类当然也自然被回收了。JRuby当然不存在这样的问题,因为其本身就是解释性语言。没有相关语言的习惯用法,而仅仅凭借4行脚本代码,就断定一门语言是否适合企业应用,实在是滑稽可笑!所以要提防那些未经你自己证实的所谓的官方展望报告吧!
至此翻译已经完毕,可是所谓的报道,本人也觉得的很可笑,不过从Graeme的答复中,本人也受益匪浅,也了解到自己对Groovy掌握还是比较肤浅的,继续努力[img]../../../images/smiles/icon_biggrin.gif" alt="[/img]
其实从报道中也可以看到Groovy正在快速的发展,当然发展过程中不可能避免的有流言蜚语,同时也说明Groovy在备受关注中。
最后,有几个有意思的链接与大家共享一下
照这样的例子java中也不会这样写的呀
<br /><pre name="code" class="java">shell = new GroovyShell()
while(true) {
shell.evaluate("x = 100")
sleep(2000)
System.gc()
}
</pre>
看这里 Using GroovyServer Pages in Dreamweaver
如果此Groovy in Action中文版公告准确的话,应该快了。
让我们期待吧,你如果有什么因为可以到GoG的圈子里提问。
http://www.huxili.com/index.php?cat=reports&id=ID000188
此报道以"Groovy and JRuby: Enterprise-Ready?"为题且得出结论是:Groovy还不适合企业仅仅是因为内存泄漏。某些人并不懂语言间习惯用法差异,而简单地放在一起进行对比,当然是无稽之谈了。
此报道并没有提供任何示例代码,更多的是通过怀疑的方式来验证其正确性,尽管如此报道还是陈述了Groovy运行在以下一些步骤的时候,会导致内存溢出:
- Call shell.evaluate("x = 100")
- Call System.gc()
- Thread.sleep(1000)
- Record used memory
- Repeating (1-4)
我要猜一下他们可能用到的Groovy代码,我敢打赌这些代码应该象下面所示那样:
shell = new GroovyShell() while(true) { shell.evaluate("x = 100") sleep(2000) System.gc() }
那么这段代码有什么问题呢?并且是怎样导致内存泄漏呢?答案很简单:每一个GroovyShell实例都有一个内部的类加载器(class
loader),而Groovy一门编译类型的语言,即便是示例中很少的一段脚本都将会被编译成类因此随着时间的流逝,类加载器将会变得越来越大。那么该
如何解决呢?请看如下代码:
while(true) { new GroovyShell().evaluate("x = 100") sleep(2000) }
这么做,JVM就会自动回收不再使用的GroovyShell (当然包括它的类加载器)了,加载器都被回收了,其旗下的类当然也自然被回收了。JRuby当然不存在这样的问题,因为其本身就是解释性语言。没有相关语言的习惯用法,而仅仅凭借4行脚本代码,就断定一门语言是否适合企业应用,实在是滑稽可笑!所以要提防那些未经你自己证实的所谓的官方展望报告吧!
至此翻译已经完毕,可是所谓的报道,本人也觉得的很可笑,不过从Graeme的答复中,本人也受益匪浅,也了解到自己对Groovy掌握还是比较肤浅的,继续努力[img]../../../images/smiles/icon_biggrin.gif" alt="[/img]
其实从报道中也可以看到Groovy正在快速的发展,当然发展过程中不可能避免的有流言蜚语,同时也说明Groovy在备受关注中。
最后,有几个有意思的链接与大家共享一下
评论
13 楼
bnmcvzx
2008-05-03
引用
shell = new GroovyShell() while(true) { shell.evaluate("x = 100") sleep(2000) System.gc() }
照这样的例子java中也不会这样写的呀
12 楼
bnmcvzx
2008-05-03
引用
<br /><pre name="code" class="java">shell = new GroovyShell()
while(true) {
shell.evaluate("x = 100")
sleep(2000)
System.gc()
}
</pre>
11 楼
geszJava
2008-01-24
找一下x:\Program Files\Macromedia\Dreamweaver 8\Configuration\DocumentTypes目录下面的MMDocumentTypes.xml文件,查找一下documenttype id="JSP",把gsp也给添加上.不过taglib是不支持的.这样只是凑合能用,完美得应该是楼主说的那样吧.
10 楼
agile_boy
2008-01-23
to winter :
very cool!!thanks
very cool!!thanks
9 楼
winter
2008-01-22
引用
但是view的gsp文件无法在dreamweaver中可视化编辑,手工写views太低效了!grails还有太长的路走!
看这里 Using GroovyServer Pages in Dreamweaver
引用
We started using Grails in our current project for one of the internal web-applications. Grails uses GroovyServer Pages (gsp) for web pages and layout templates (you can also use JSP instead). As I don’t like to use Eclipse for web-design tasks, I figured out how to add gsp support to Dreamweaver (CS3).
Step 1: Add .gsp file extension
Edit the Extensions.txt file, which can be found here:
Windows: \Documents and Settings\username\Application Data\Adobe\Dreamweaver 9\Configuration
Mac OS X: /Users/username/Library/Application Support/Adobe/Dreamweaver 9/Configuration
Add a new line with GSP:Groovy Server Pages and add the gsp extension to the first line. Restart Dreamweaver, which will now recognize the .gsp files and open them in the editor.
Next, add the following code to configuration/DocumentTypes/MMDocumentTypes.xml
Adjust the id values if necessary. In the folder NewDocuments create a Default.gsp file. Gsp files are not being shown as option in the new files dialog yet, so the Default file is not being used. If someone knows how to do this, please let me know.
It takes adobe a couple of pages to explain it all in detail: http://www.adobe.com/go/16410
Step 2: Add the gsp tag library
Download the GspTagLibrary for Dreamweaver, unpack it and copy the gsp folder to the TagLibraries folder within the configuration folder. Add the text of gspTagLibrary.vtm to the existing TagLibraries.vtm file.
Step 3: Enable code coloring
Open CodeColoring.xml (Configuration/CodeColering) in an editor and add gsp to the doctypes attribute of the entries for Html, JavaScript and CSS. Restart Dreamweaver.
Next step could be to add a special color schema for gsp tags and groovy when using scriptlets and maybe one day I will have time to learn how to write Dreamweaver Extensions, which would hopefully make it possible to do all of this automatically.
Step 1: Add .gsp file extension
Edit the Extensions.txt file, which can be found here:
Windows: \Documents and Settings\username\Application Data\Adobe\Dreamweaver 9\Configuration
Mac OS X: /Users/username/Library/Application Support/Adobe/Dreamweaver 9/Configuration
Add a new line with GSP:Groovy Server Pages and add the gsp extension to the first line. Restart Dreamweaver, which will now recognize the .gsp files and open them in the editor.
Next, add the following code to configuration/DocumentTypes/MMDocumentTypes.xml
<documenttype id="GSP" internaltype="Dynamic" winfileextension="gsp" macfileextension="gsp" file="Default.gsp" writebyteordermark="false"> <TITLE> <MMString:loadString id="mmdocumenttypes_70" /> </TITLE> <description> <MMString:loadString id="mmdocumenttypes_71" /> </description> <dtdcontext>html</dtdcontext> </documenttype>
Adjust the id values if necessary. In the folder NewDocuments create a Default.gsp file. Gsp files are not being shown as option in the new files dialog yet, so the Default file is not being used. If someone knows how to do this, please let me know.
It takes adobe a couple of pages to explain it all in detail: http://www.adobe.com/go/16410
Step 2: Add the gsp tag library
Download the GspTagLibrary for Dreamweaver, unpack it and copy the gsp folder to the TagLibraries folder within the configuration folder. Add the text of gspTagLibrary.vtm to the existing TagLibraries.vtm file.
Step 3: Enable code coloring
Open CodeColoring.xml (Configuration/CodeColering) in an editor and add gsp to the doctypes attribute of the entries for Html, JavaScript and CSS. Restart Dreamweaver.
Next step could be to add a special color schema for gsp tags and groovy when using scriptlets and maybe one day I will have time to learn how to write Dreamweaver Extensions, which would hopefully make it possible to do all of this automatically.
8 楼
winter
2008-01-22
要是非得在DW编辑,把gsp临时改成jsp。。。。。。。
7 楼
魔力猫咪
2008-01-22
最近正在看Grails。书是从网上下来的,虽然旧了点,但还是很不错的。用Grails快速开发好舒服。
6 楼
lordhong
2008-01-22
我喜欢groovy,2008年喜欢可以多多用上
5 楼
murainwood
2008-01-22
Grails,半敏不捷
4 楼
agile_boy
2008-01-21
qieren 写道
groovy in action还会有中文版吗?...英语太烂...都等了好久了
如果此Groovy in Action中文版公告准确的话,应该快了。
让我们期待吧,你如果有什么因为可以到GoG的圈子里提问。
3 楼
qieren
2008-01-21
groovy in action还会有中文版吗?...英语太烂...都等了好久了
2 楼
agile_boy
2008-01-21
gsp跟jsp是一脉相通的,如果喜欢拖拽,可以尝试JSF啊
1 楼
ourfirebird
2008-01-21
但是view的gsp文件无法在dreamweaver中可视化编辑,手工写views太低效了!grails还有太长的路走!
发表评论
-
Grails跟Hibernate和Mongodb的组合
2011-08-08 23:19 3426标题看起来很噱头哦 先简要说明一下我在项目中的必要场 ... -
一个属性未设置导致发mail不成功的郁闷。
2011-04-10 20:42 2694难得阳光灿烂的周末啊,确被javamail的一个属性未设置 ... -
Grails 关于单元/集成测试
2011-02-17 11:06 2038Grails提供了比较方便的测试,其默认提供了单元,集成测 ... -
[转载]Grails plugins on Hudson
2010-07-03 11:48 1893此文也是因为被“墙”才转载的,原文地址:http: ... -
Grails 1.3的依赖管理
2010-07-03 11:42 3568用Grails做项目以来,基本上一直都是各自独立的项目,也 ... -
[转载] Reading i18n messages from the database with Grails
2010-06-27 23:45 1494如题,此文是Grails的作者的一篇文章,无奈被墙,同时 ... -
[转载] Adventures in Grails – WS-Security Part 2
2010-06-13 23:10 1284原文url:http://axixmiqui.wordp ... -
[转载]Adventures in Grails – WS-Security Part 1
2010-06-06 22:18 1453转载是因为此文网站被墙了。 The next s ... -
grails 1.2 生成相关IDE和ANT的配置文件
2010-01-24 14:48 1257做了一个Grails的小应用测试一下,发现相比1.1.1, ... -
grails,xfire和groovyws共存
2009-09-04 10:25 2229使用Grails开发WebService服务,方便快捷就无须再 ... -
Grails 从1.0.4 到 1.1的升级小结
2009-03-13 13:17 2218先将官方的升级注意事项简单罗列,我也是参照此进行升级的。 ... -
Grails 1.1 正式版发布
2009-03-11 01:57 2550在比较漫长的期待之后(期间经历了Grails被Spring ... -
Grails1.0.4的scaffolding
2008-11-17 16:06 1334使用Grails的动态脚手架(dynamic scaffold ... -
grails JobExecutionException编译错误
2008-07-08 11:46 1610使用Grails插件的要注意了,jsecurity中自带了 ... -
Grails 1.0.3发布
2008-06-07 16:45 1901现在想想Grails1.0.2发布也有些许时间了,其间Gr ... -
Grails中文参考手册一审完毕,初步发行一个beta版
2008-05-06 18:10 4346详细信息请参考Grails参考手册的官方信息: http: ... -
Groovy 1.6-beta-1发布,性能有大幅提高!
2008-05-03 14:57 2329感谢G2One和Groovy开发团队为我们发布了Groovy ... -
Grails喜获JAX大奖
2008-04-27 11:36 1621前几天Grails获得提名,现在终于水到渠成了,获得JAX大奖 ... -
Groovy1.5.6发布
2008-04-26 09:55 1670Groovy1.5.5在编译速度有所提升以后,G2ONE很 ... -
Groovy1.5.5发布
2008-04-15 09:38 1586G2One, Inc和Groovy开发小组非常荣幸的宣布:Gr ...
相关推荐
原作者:Graeme Merrall -------------------------------------------------------------------------------- 本文介绍堪称Web数据库黄金组合的PHP/MySQL如何构筑一个网络数据库应用的方法,PHP是一个类似...
% 计算出自 Jerald Graeme 的书 [1]。 % 用户可以从供应商处提供自己的电子元件% 制造商数据表。 % % 用法: % 用于光电二极管跨阻中的频率和噪声分析% 放大器开发。 % % 需要专门的 Matlab 工具箱: % 没有任何...
Jerald G. Graeme_Amplifier Applications of Op Amps.pdf
# Graeme Hiebert May 01, 1997 Added code to handle TXT subfile. # Graeme Hiebert Jun 03, 1997 Added multiple label cover # # attributes to POLY_CENTROID_2 # and POLY_CENTROID_2_DOUBLE. # Graeme ...
This newly updated book offers a comprehensive introduction to the scope and nature of engineering work, taking a rigorous but common sense approach to the solution of engineering problems. ...
According to Graeme, PHP and MySQL are the world s best combination for creating data-driven sites. In the first installment of this three-lesson tutorial, our Kiwi guide covers everything you need ...
Author(s): Graeme P. Maxton, John Wormald Publisher: Cambridge University Press Year: 2004 Language: English Pages (biblio\tech): 296\296 ISBN: 0521837154, 9780521837156 This book is for anyone ...
该存储库随附Graeme Stuart撰写的(Apress,2017年)。 使用绿色按钮将文件下载为zip格式,或使用Git将存储库克隆到您的计算机上。 发行版 版本v1.0对应于已出版书籍中的代码,没有更正或更新。 会费 请参阅文件...
维护者本课程的当前维护者是格雷姆·格里姆斯(Graeme R.作者可以在“找到该课程的参与者列表引文要引用本课程,请向咨询贡献我们欢迎您为改进本课程而做出的所有贡献! 如果您在此过程中有任何疑问,疑虑或遇到任何...
grails参考文档 The Grails Framework - Reference Documentation Authors: Graeme Rocher, Marc Palmer Version: 1.0.3
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright...
该资源是对于语料库初学者有一定的启示作用,而且对语料库深入学习者有很大的启发作用
柯克·马丁内斯(Kirk Martinez),乔什·库里(Josh Curry),菲利普·巴斯福德(Philip Basford),格雷姆·布拉格(Graeme Bragg),2017年,英国南安普敦大学电子与计算机科学,请参见 提醒新的Ubuntu安装需要...
有限状态机模型我该如何使用? 它尚未完成,但可用于制作一些有限状态机并对其进行基本操作,因此请确保已下载GraphViz,以便在启动时可以将目录提供至graphviz / bin / dot.exe以便程序能够制作其图表。...
Graeme Birchall, a DB2 for LUW authority, puts out free PDF-format "SQL cookbooks" with sample code, tricks and hints.
(Graeme Hirst) by 李登和杨柳 作者:霍布森·莱恩 (Hobson Lane)、科尔·霍华德 (Cole Howard) 和汉尼斯·哈普克 (Hannes Hapke) 深度学习:The LazyProgrammer 在 Python 中的自然语言处理(仅限 Kindle) 作者 ...
Grails是一个搭建在动态语言 Groovy 之上的开源 MVC 快速 Web 开发框架。使用 Grails 可以提高 Web 开发的效率,降低 Web 开发的复杂度。 本书由Grails项目负责人Graeme Keith Rocher编写,极具权威性 pdf格式 英文
Mike Schaekermann,Graeme Beaton,Elaheh Sanoubari,Andrew Lim,Kate Larson和Edith Law:。 Mike Schaekermann,Graeme Beaton,Minahz Habib,Andrew Lim,Kate Larson和Edith Law:。 。 该存储库仅包含...
(Graeme & Chris 团队,2018 年 Battlesnake Victoria 专家组冠军,见验尸报告) (用于参加 BattleSnake 2017 比赛的 Python AI) (战蛇2019中进入的蛇) (用 Cincom Smalltalk 编写的 Battlesnake.io 比赛代码...
经典Grails书籍,针对Grails 2的升级版本,作者是: Graeme Rocher (Grails作者) Jwff Scott Brown