Thread: [PI] Java Errors 20$ Reward

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 [PI] Java Errors 20$ Reward 
    Exiles Developer


    Join Date
    May 2009
    Age
    28
    Posts
    316
    Thanks given
    55
    Thanks received
    25
    Rep Power
    86
    I used a Vpsland, 512mb ram vps with 10gb hard drive before and i got java errors all the time..
    I just upgraded to a Myhosting 8gb ram dedi with 140gb hard drive and i am STILL getting them just as bad.

    I tried updating my run.bat to xmx8000m, then xmx6000m, now xmx5000m:
    @echo off
    title MasterPkz
    java -Xms512m -cp bin;deps/poi.jar;deps/mysql.jar;deps/mina.jar;deps/slf4j.jar;deps/slf4j-nop.jar;deps/jython.jar;log4j-1.2.15.jar; server.Server
    pause
    Yes, i have heard of the eventmanager having a memory leak, i don't know how to fix though.. Please fix this.. [MAIN PROBLEM]
    Still getting java errors..
    Any advice? Like any possible ways to make this problem happen less or to get rid of it?(DO NOT ADVISE ME TO SWITCH SOURCES.)
    If solved, i will provide you with $20 payment via Paypal AFTER the fix, this is GARENTEED.
    I am getting desperate for a fix, i have the cash needed:
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Apr 2009
    Posts
    675
    Thanks given
    707
    Thanks received
    32
    Rep Power
    1131
    You installed Java/JDK on the VPS / Dedi right? lol...
    Reply With Quote  
     

  3. #3  
    Exiles Developer


    Join Date
    May 2009
    Age
    28
    Posts
    316
    Thanks given
    55
    Thanks received
    25
    Rep Power
    86
    Yea i installed jdk..
    Reply With Quote  
     

  4. #4  
    Registered Member
    Trock's Avatar
    Join Date
    Jul 2009
    Age
    28
    Posts
    1,915
    Thanks given
    14
    Thanks received
    66
    Rep Power
    532
    add my msn [email protected]

    or

    send me ur teamviewer info in pm
    Quote Originally Posted by Psyduck View Post
    Vouch

    Quote Originally Posted by VelSion View Post
    Huge Vouch, made so many deals with him, went smoothly!
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    May 2010
    Posts
    1,550
    Thanks given
    92
    Thanks received
    154
    Rep Power
    0
    Try lowering the 8000 to like 512 or 1000 in run.bat
    Reply With Quote  
     

  6. #6  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    how long are u leaving the dedi running? cuz causing that much ram usage can bog it down until it uses it all if theres a memory leak
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Feb 2008
    Posts
    384
    Thanks given
    30
    Thanks received
    26
    Rep Power
    0
    you have a memory leak

    here are some tips on finding it

    Finding Memory Leaks in Java Apps - The Empty Way
    Reply With Quote  
     

  8. #8  
    Registered Member
    Its paris's Avatar
    Join Date
    Apr 2009
    Posts
    1,141
    Thanks given
    56
    Thanks received
    234
    Rep Power
    689
    Tried setting the standard memory usage? "-Xms512m"
    Reply With Quote  
     

  9. #9  
    Exiles Developer


    Join Date
    May 2009
    Age
    28
    Posts
    316
    Thanks given
    55
    Thanks received
    25
    Rep Power
    86
    I have tried setting it to "-Xmx5000m" and "-Xms512m" i am currently using xms512 but it has been erroring still over the past days, i was told the eventmanager has memory leaks in it, but i can't find them and i don't understand of the tutorials on finding them.
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jan 2008
    Posts
    51
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by x dds pk x View Post
    I have tried setting it to "-Xmx5000m" and "-Xms512m" i am currently using xms512 but it has been erroring still over the past days, i was told the eventmanager has memory leaks in it, but i can't find them and i don't understand of the tutorials on finding them.
    This MIGHT help you not sure though!
    Code:
    package server.event;
    
    
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import server.util.Misc;
    
    /**
     * Manages events which will be run in the future.
     * Has its own thread since some events may need to be ran faster than the cycle time
     * in the main thread.
     * 
     * @author Graham
     *
     */
    public class EventManager implements Runnable {
    	
    	/**
    	 * A reference to the singleton;
    	 */
    	private static EventManager singleton = null;
    	
    	/**
    	 * A list of events that are being executed.
    	 */
    	private List<EventContainer> events;
    	
    	/**
    	 * Initialise the event manager.
    	 */
    	private EventManager() {
    		events = new ArrayList<EventContainer>();
    	}
    	
    	/**
    	 * The event manager thread. So we can interrupt it and end it nicely on shutdown.
    	 */
    	private Thread thread;
    	
    	/**
    	 * Gets the event manager singleton. If there is no singleton, the singleton is created.
    	 * @return The event manager singleton.
    	 */
    	public static EventManager getSingleton() {
    		if (singleton == null) {
    			singleton = new EventManager();
    			singleton.thread = new Thread(singleton);
    			singleton.thread.start();
    		}
    		return singleton;
    	}
    	
    	/**
    	 * Initialises the event manager (if it needs to be).
    	 */
    	public static void initialize() {
    		getSingleton();
    	}
    	
    	
    	/**
    	 * The waitFor variable is multiplied by this before the call to wait() is made.
    	 * We do this because other events may be executed after waitFor is set (and take time).
    	 * We may need to modify this depending on event count? Some proper tests need to be done.
    	 */
    	private static final double WAIT_FOR_FACTOR = 0.5;
    
    	@Override
    	/**
    	 * Processes events. Works kinda like newer versions of cron.
    	 */
    	public synchronized void run() {
    		long waitFor = -1;
    		List<EventContainer> remove = new ArrayList<EventContainer>();
    		
    		while (true) {
    			
    			// reset wait time
    			waitFor = -1;
    			
    			// process all events
    			for (EventContainer container : events) {
    				if (container.isRunning()) {
    					if ((System.currentTimeMillis() - container.getLastRun()) >= container.getTick()) {
    						container.execute();
    					}
    					if (container.getTick() < waitFor || waitFor == -1) {
    						waitFor = container.getTick();
    					}
    				} else {
    					// add to remove list
    					remove.add(container);
    				}
    			}
    			
    			// remove events that have completed
    			for (EventContainer container : remove) {
    				events.remove(container);
    			}
    			remove.clear();
    			
    			// no events running
    			try {
    				if (waitFor == -1) {
    					wait(); // wait with no timeout
    				} else {
    					// an event is running, wait for that time or until a new event is added
    					int decimalWaitFor = (int)(Math.ceil(waitFor*WAIT_FOR_FACTOR));
    					wait(decimalWaitFor);
    				}
    			} catch(InterruptedException e) {
    				break; // stop running
    			}
    		}
    	}
    	
    	/**
    	 * Adds an event.
    	 * @param event The event to add.
    	 * @param tick The tick time.
    	 */
    	public synchronized void addEvent(Event event, int tick) {
    		events.add(new EventContainer(event,tick));
    		notify();
    	}
    	
    	/**
    	 * Shuts the event manager down.
    	 */
    	public void shutdown() {
    		this.thread.interrupt();
    	}
    
    }
    Credits
    0% ME
    100% GRAHAM
    Ohai dere human!
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Errors... [Reward]
    By Mage k0 in forum Help
    Replies: 1
    Last Post: 04-05-2010, 02:29 AM
  2. Java Errors
    By Sam in forum Help
    Replies: 9
    Last Post: 04-17-2009, 09:45 PM
  3. (525) equipment.java errors (engine.java)
    By Silicity in forum Help
    Replies: 4
    Last Post: 02-18-2009, 02:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •