Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-17-2007, 02:45 AM
Member
 
Join Date: Jul 2007
Posts: 2
stonkers is on a distinguished road
Java Heap Out of Memory Error
I'm running a vbscript that uses a java sdk to gather information. It's throwing a Java Heap out of memory error. I know how to assign memory to a java app, but how can I assign it to a vbscript. Can I do so inside the code?

Thanks,
Eric
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-17-2007, 09:03 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
How do you access JDK from vbscript? If we know that, we might be able to help..
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-17-2007, 06:23 PM
Member
 
Join Date: Jul 2007
Posts: 2
stonkers is on a distinguished road
Not the JDK, the Borland StarTeam SDK. Here's what it does conceptually (StarTeam SDK Link) Here's most of the code (I stopped short because of the 10,000 char thread limitation):

Code:
'-------------------------------------------- ' $Workfile: AccessRights.vbs$ ' $Author: Steven Lange$ ' $Date: 8/4/2000 6:50:37 AM$ ' $Revision: 11$ ' Requirements: ' - StarGateSDK ' - Windows Scripting Host '-------------------------------------------- Dim strServer, nPort, strFileName Dim strUser, strPassword ' ~~~ Modify these values for your needs ~~~ ' strAddress = "myServerName" nPort = 49201 strUser = "Administrator" strPassword = "MyAdminPassword" strFileName = "AccessRights.txt" ' ~~~ Don't modify below here! ~~~ ' ' Check for command-line parameters ' server address If (WScript.Arguments.Count > 0) Then strAddress = WScript.Arguments(0) End If ' server port If (WScript.Arguments.Count > 1) Then nPort = CInt(WScript.Arguments(1)) End If ' user name If (WScript.Arguments.Count > 2) Then strUser = WScript.Arguments(2) End If ' password If (WScript.Arguments.Count > 3) Then strPassword = WScript.Arguments(3) End If 'filename If (WScript.Arguments.Count > 4) Then strFileName = WScript.Arguments() End If ' Grant or Deny? Function GD(ByVal granted) if Granted = True then GD = "Grant" else GD = "Deny" end if End Function ' Get Name of User or Group. Function getName(ByVal id, ByVal isGroup) if isGroup = True then getName = StServer.Administration.findGroupAccount(id).Name else getName = StServer.Administration.findUserAccount(id).Name end if End Function ' Write the access rights entries. Sub WriteACL(ByVal list, ByVal p,ByVal aType) dim e For e = 0 to list.Count-1 FileObj.WriteLine(Space(8) & e+1 & ". " & GD(list(e).Granted) & " - " & getName(list(e).id,list(e).GroupID)) Select Case aType '0=server,1=project,2=view,3=folder Case 0 ' server PServer list(e),p Case 1 ' project PGeneric list(e),p PItem list(e),p Case 2 ' view PGeneric list(e),p PItem list(e),p Case Else ' other PGeneric list(e),p PItem list(e),p End Select next End Sub ' Write the permissions Sub PGeneric(ByVal entry,ByVal p) if entry.hasPermission(p.GENERIC_AQUIRE_OWNERSHIP) then FileObj.Write(Space(13) & "- Acquire Object Ownership" & VbCrLf) end if if entry.hasPermission(p.GENERIC_CHANGE_ACCESS_RIGHTS) then FileObj.Write(Space(13) & "- Modify Security Settings" & VbCrLf) end if if entry.hasPermission(p.GENERIC_CREATE_NEW_OBJECT) then FileObj.Write(Space(13) & "- Create New Object" & VbCrLf) end if if entry.hasPermission(p.GENERIC_DELETE_OBJECT) then FileObj.Write(Space(13) & "- Delete Object" & VbCrLf) end if if entry.hasPermission(p.GENERIC_MODIFY_OBJECT) then FileObj.Write(Space(13) & "- Modify Object Properties" & VbCrLf) end if if entry.hasPermission(p.GENERIC_PURGE_OBJECT) then FileObj.Write(Space(13) & "- Purge Object" & VbCrLf) end if if entry.hasPermission(p.GENERIC_SEE_OBJECT) then FileObj.Write(Space(13) & "- See Object and its Properties" & VbCrLf) end if End Sub Sub PServer(ByVal entry,ByVal p) if entry.hasPermission(p.SERVER_ADMIN_REMOTELY) then FileObj.Write(Space(13) & "- Remotely Administer Server" & VbCrLf) end if if entry.hasPermission(p.SERVER_ADMIN_USER_ACCOUNTS) then FileObj.Write(Space(13) & "- Administer User Accounts" & VbCrLf) end if if entry.hasPermission(p.SERVER_CREATE_PROJECT) then FileObj.Write(Space(13) & "- Create New Project" & VbCrLf) end if if entry.hasPermission(p.SERVER_MODIFY_CONFIGURATION) then FileObj.Write(Space(13) & "- Modify Server Configuration" & VbCrLf) end if if entry.hasPermission(p.SERVER_MODIFY_SCHEMA) then FileObj.Write(Space(13) & "- Modify Database Schema" & VbCrLf) end if if entry.hasPermission(p.SERVER_MODIFY_SYSTEM_POLICY) then FileObj.Write(Space(13) & "- Modify System Policy" & VbCrLf) end if if entry.hasPermission(p.SERVER_VIEW_CONFIGURATION) then FileObj.Write(Space(13) & "- View Server Configuration" & VbCrLf) end if if entry.hasPermission(p.SERVER_VIEW_DIAGNOSTICS) then FileObj.Write(Space(13) & "- View Server Diagnostics" & VbCrLf) end if if entry.hasPermission(p.SERVER_VIEW_LOG) then FileObj.Write(Space(13) & "- View Server Log" & VbCrLf) end if if entry.hasPermission(p.SERVER_VIEW_SECURITY_LOG) then FileObj.Write(Space(13) & "- View Server Security Log" & VbCrLf) end if if entry.hasPermission(p.SERVER_VIEW_SYSTEM_POLICY) then FileObj.Write(Space(13) & "- View System Policy" & VbCrLf) end if End Sub Sub PView(ByVal entry,ByVal p) if entry.hasPermission(p.VIEW_CREATE_LABEL) then FileObj.Write(Space(13) & "- Create Label" & VbCrLf) end if if entry.hasPermission(p.VIEW_DEFINE_PROMOTION_MODEL) then FileObj.Write(Space(13) & "- Define Promotion Model" & VbCrLf) end if if entry.hasPermission(p.VIEW_DELETE_LABEL) then FileObj.Write(Space(13) & "- Delete Label" & VbCrLf) end if if entry.hasPermission(p.VIEW_EDIT_LABEL) then FileObj.Write(Space(13) & "- Modify Label" & VbCrLf) end if if entry.hasPermission(p.VIEW_MODIFY_PROMOTION_STATUS) then FileObj.Write(Space(13) & "- Modify Promotion Status" & VbCrLf) end if End Sub Sub PItem(ByVal entry,ByVal p) if entry.hasPermission(p.FILE_CHECKIN) then FileObj.Write(Space(13) & "- Check In File" & VbCrLf) end if if entry.hasPermission(p.FILE_CHECKOUT) then FileObj.Write(Space(13) & "- Check Out File" & VbCrLf) end if if entry.hasPermission(p.ITEM_ADD_LABEL) then FileObj.Write(Space(13) & "- Create New Label" & VbCrLf) end if if entry.hasPermission(p.ITEM_ADJUST_LABEL) then FileObj.Write(Space(13) & "- Adjust Label" & VbCrLf) end if if entry.hasPermission(p.ITEM_BREAK_EXCLUSIVE_LOCK) then FileObj.Write(Space(13) & "- Break Exclusive Lock" & VbCrLf) end if if entry.hasPermission(p.ITEM_CREATE_LINKS) then FileObj.Write(Space(13) & "- Create Links" & VbCrLf) end if if entry.hasPermission(p.ITEM_DELETE_LINKS) then FileObj.Write(Space(13) & "- Delete Links" & VbCrLf) end if if entry.hasPermission(p.ITEM_DETACH_LABEL) then FileObj.Write(Space(13) & "- Detach Label" & VbCrLf) end if if entry.hasPermission(p.ITEM_LOCK_EXCLUSIVELY) then FileObj.Write(Space(13) & "- Set Exclusive Lock" & VbCrLf) end if if entry.hasPermission(p.ITEM_MODIFY_BEHAVIOR) then FileObj.Write(Space(13) & "- Modify Item Behavior" & VbCrLf) end if if entry.hasPermission(p.ITEM_MODIFY_LINKS) then FileObj.Write(Space(13) & "- Modify Links" & VbCrLf) end if if entry.hasPermission(p.ITEM_PERFORM_MAINTENANCE) then FileObj.Write(Space(13) & "- Perform Item Maintenance" & VbCrLf) end if if entry.hasPermission(p.ITEM_SEE_HISTORY) then FileObj.Write(Space(13) & "- See History" & VbCrLf) end if if entry.hasPermission(p.ITEM_SEE_LINKS) then FileObj.Write(Space(13) & "- See Links" & VbCrLf) end if if entry.hasPermission(p.ITEM_SHARE_MOVE) then FileObj.Write(Space(13) & "- Share/Move Items" & VbCrLf) end if End Sub ' Write a string of characters. Sub FillChars(ByVal ch,ByVal length) dim x for x = 1 to length FileObj.Write(ch) next FileObj.Write(vbCrLf) End Sub ' Write the report header. Sub WriteHeader() FillChars "=",70 FileObj.WriteLine("STARTEAM ACCESS RIGHTS REPORT") FillChars "=",70 FileObj.WriteBlankLines(1) FileObj.WriteLine("KEY: Project::ViewPath::FolderPath" & vbCrLf) FileObj.WriteLine("** This report was run against StarTeam Server: " & strAddress & ":" & nPort & vbCrLf) End Sub ' Write the report footer. Sub WriteFooter() FillChars "-",70 FileObj.WriteLine("END REPORT" & Space(60-Len(Now())) & Now()) FillChars "-",70 End Sub Function CheckforACL(myACL) if UCase(TypeName(myACL)) <> "NOTHING" then CheckforACL = True else CheckforACL = False end if End Function ' Enumerate through the projects. Sub EnumProjects(ByVal StServer) dim proj for each proj in StServer.Projects found = false if CheckforACL(proj.acl) = true then if found = false then FileObj.WriteLine(proj.Name) found = true end if FileObj.WriteLine(Space(5) & "*" & cons(0)) WriteACL proj.acl,p,1 end if for c = 1 to 6 if CheckforACL(proj.getContainerLevelACL(cons(c))) = true then if found = false then FileObj.WriteLine(proj.Name) found = true end if FileObj.WriteLine(Space(5) & "*" & cons(c) & "s:") WriteACL proj.getContainerLevelACL(cons(c)),p,c+1 end if next EnumViews proj FileObj.WriteBlankLines(1) next End Sub
Thanks for the reply!
Eric
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-17-2007, 06:43 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
As far as i understand your problem your problem is not related to JDK but related to StarTeam SDK. I think you should ask this on their support forums/email lists ... At least i dont know the answer. Good luck.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Heap Sort in Java Java Tip Algorithms 0 04-17-2008 12:27 AM
Low memory error rlhs76 New To Java 2 02-09-2008 12:25 AM
JVM Heap memory settings nagesh New To Java 1 08-12-2007 12:17 AM
How to reduce the size or avoiding out of memory error? rajeshkumarmsc Advanced Java 3 08-12-2007 12:15 AM
JVm Heap memory settings nagesh Advanced Java 0 08-11-2007 04:49 PM


All times are GMT +3. The time now is 11:19 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org