在系统测试中最近部署之后,我们的一个servlet比平时受到更大的打击,我们注意到内存开始攀升,weblogic最终会死亡.我的实习生,我非常自豪,发现了内存泄漏的来源.
每当请求进入时,都会调用此行:
JAXBContext jc = JAXBContext.newInstance(“ruby.oracle_servlet.schemas”);
Run Code Online (Sandbox Code Playgroud)
出于某种原因,对象永远不会被垃圾收集.一旦我们将它静态化并移动到我们初始化它的位置,我们的内存泄漏便消失了.
我们的另一个开发人员在独立的Java应用程序中将该行放在while循环中,并且还看到了内存蠕变.
有没有人有任何想法为什么该对象不会被垃圾收集?
谢谢
我们有一个iPad应用程序正在我们的旧iPad上工作.
我们使用var x = window.open(url)打开外部链接
在一天结束时,当用户关闭应用程序的这一部分时,我们会浏览它打开的所有窗口并为每个窗口执行x.close(),一切都很好.
使用IOS 5测试新iPad和可爱的选项卡,打开新窗口(虽然现在它们以标签打开)很好,但是x.close()似乎不一定关闭x,它可能关闭窗口y或ž.执行x.focus()或y.focus()工作正常,正确的选项卡成为焦点,但关闭似乎只是选择它想要的任何选项卡.
这是一个错误还是我做错了什么?示例程序:
<html>
<head></head>
<body>
<script>
//The openWindow array will hold the handles of all open child windows
var openWindow = new Array();
var win1;
var win2;
//Track open adds the new child window handle to the array.
function trackOpen(winName) {
openWindow[openWindow.length]=winName;
}
//loop over all known child windows and try to close them. No error is
//thrown if a child window(s) was already closed.
function closeWindows() {
var openCount = openWindow.length;
for(r=openCount-1;r>=0;r--) …Run Code Online (Sandbox Code Playgroud)